시간 제한 조작 및 JDBC 호출
시간 제한 조작은 애플리케이션 서버의 JDBC 호출이 예상보다 느리거나 빨리 작동할 때 경고를 로깅합니다.
개요
사용하는 경우 시간 제한 조작 기능이 애플리케이션 서버에서 실행 중인 JDBC 조작의 기간을 추적합니다. 조작을 실행하는 데 걸린 시간이 예상보다 길거나 짧으면 시간 제한 조작 기능이 경고를 로깅합니다. 시간 제한 조작 기능은 애플리케이션 서버 로그에 주기적으로 보고서를 작성하여 실행하는 데 시간이 가장 오래 걸린 조작에 대해 자세히 설명합니다. 서버 덤프 명령을 실행하면 시간 제한된 조작 기능이 추적한 모든 조작에 대한 정보가 들어 있는 보고서를 생성합니다. 이러한 보고서에 나열된 정보를 사용하여 예상보다 느리거나 빨리 실행 중인 조작이 있는지 판별할 수 있습니다.
정기적으로, 시스템은 10개의 가장 긴 JDBC 시간 제한 오퍼레이션을 포함하는 로그에 대해 보고서를 생성합니다. 이 보고서의 빈도와 사용 가능성은 1일(24 시간)당 일 회의 기본값을 사용하여 server.xml 파일에 구성 가능합니다.
시간 제한 오퍼레이션을 사용 가능하게 하려면 server.xml 파일에 timedOperations-1.0 기능을 추가하십시오.
다음 예제와 같이 timedOperation 요소를 사용하여 로그에 대해 보고서를 생성할 수 없도록 설정하거나 보고서의 빈도(예: 12시간마다 한 번)를 변경할 수 있습니다.
<timedOperation enableReport="false" reportFrequency="12"/>
<timedOperation enableReport="false" reportFrequency="12" maxNumberTimedOperations="10000"/>
이 예제는
다음과 같이 시간 제한 오퍼레이션 횟수가 10000을 초과할 때
로그에 경고 메시지를 생성합니다. [4/18/13 23:01:37:316 EDT] 0000002c com.ibm.wsspi.timedoperations.TimedOperationService W TRAS0094I:
The total number of timed operations is 10000, which exceeds the configured maximum number of 10000.
You can also find the number of timed operations in the report that is periodically generated to the logs.
If you find that the number of timed operations is excessive, you can disable the timed operations feature.
![[8.5.5.2 이상]](../ng_v8552.gif)
TRAS0095I: The total number of timed operations has reached the configured maximum of 10000. As new timed operations are created the least recently used timed operations will be removed to maintain the total number of tracked timed operations at this level.
또한 server dump 명령을 사용하여 유형별로 그룹화되고 실제 지속 기간의 평균을 기준으로 각 그룹 내에서 정렬된 messages.log 파일에 있는 모든 시간 제한 조작의 전체 보고서를 가져올 수 있습니다.
다음 예제는 로그된 메시지의 샘플을 보여줍니다.
[3/14/13 14:01:25:960 CDT] 00000025 TimedOperatio W TRAS0080W: Operation websphere.datasource.execute:
jdbc/exampleDS:insert into cities values ('myHomeCity', 106769, 'myHomeCountry') took 1.541 ms to complete,
which was longer than the expected duration of 0.213 ms based on past observations.
다음 예제는 로그에서 자동으로 생성된 보고서의 샘플을 보여줍니다.
[12/13/12 7:42:29:509 CST] 0000001d com.ibm.wsspi.timedoperations.TimedOperationService I TRAS0092I:
The following operations took the longest time to run since the last report has been generated:
Operation websphere.datasource.execute:jdbc/exampleDS:insert into cities values ('myHomeCity',
106769, 'myHomeCounty') took 194ms to complete
Operation websphere.datasource.execute:jdbc/exampleDS:select county from cities where name=
'myHomeCity' took 187ms to complete
Operation websphere.datasource.execute:jdbc/exampleDS:drop table cities took 182ms to
complete\Operation websphere.datasource.execute:jdbc/exampleDS:insert into cities values
('myHomeCity', 106769, 'myHomeCounty') took 151ms to complete
시간 제한된 조작을 완전히 구성하는 데 대한 참조는 server.xml 파일의 구성 요소 주제의 timedOperation 요소를 확인하십시오.