본문으로 건너뛰기

19.1 서버 모니터링

JBoss EAP 6의 서버기본 정보는 platform-mbean 코어 서비스(core-service=platform-mbean)에서 얻을 수 있다. 다음과 같은 자원 정보를 제공하고 있다.

  • OS정보
  • 메모리 정보
  • Thread 정보
  • 런타임 정보

OS 정보

실행 중인 JBoss EAP 6 서버의 OS 기본 정보를 확인할 수 있다. 주요 속성값은 아래와 같다.

속성설명
nameOS 이름
archOS 아키텍쳐
versionOS 버전 정보
available-processors사용 가능한 프로세서의 개수
system-load-average시스템 로드 평균

표 1. OS의 기본 정보

CLI로 다음과 같이OS정보를 출력한다.

[standalone@localhost:9999 /] /core-service=platform-mbean/type=operating-system:read-resource

{

"outcome" => "success",
"result" => {
"name" => "Linux",
"arch" => "amd64",
"version" => "2.6.32-279.el6.x86_64",
"available-processors" => 4,
"system-load-average" => 0.0
}
}

자바 메모리의 정보

실행중인 JBoss EAP 6 서버의 힙 메모리 영역(heap-memory-usage)과 Non 힙 메모리 영역(non-heap-memory-usage)의 사용 현황을 확인할 수 있다. 메모리 정보에 대한 주요 속성값은 다음 표와 같다.

속성설명
init초기에 할당한 메모리 양
used현재 사용하고 있는 메모리 양
committed현재 사용 가능한 메모리 양
maxJVM이 할당하는 메모리의 최댓값

표 2. 메모리 정보의 주요 속성

아래와 같이 CLI로 메모리의 사용 현황을 출력한다.

[standalone@localhost:9999 /] /core-service=platform-mbean/type=memory:read-attribute(name=heap-memory-usage)

{
"outcome" => "success",
"result" => {
"init" => 1366294528L,
"used" => 106635768L,
"committed" => 1309081600L,
"max" => 1309081600L
}
}

스레드 정보

실행 중인 JBoss EAP 6 서버의 스레드 정보를 얻을 수 있다. 스레드 정보의 주요 속성값은 다음 표와 같다.

속성설명
all-thread-ids실행중인 스레드 ID 목록
current-thread-user-time현재 스레드의 사용자 시간. 단위는 nanoseconds
current-thread-cpu-time현재 스레드의 CPU 시간
thread-count현재 사용중인 스레드 개수
peak-thread-count스레드 개수의 피크시 값
daemon-thread-count데몬 스레드의 개수
total-started-thread-count서버 구동 후 시작된 스레드 합계

표 3. 스레드 정보의 주요 속성

아래와 같이 CLI로 JBoss가 현재 사용하는 스레드 개수를 얻을 수 있다.

[standalone@localhost:9999 /] cd /core-service=platform-mbean/type= threading

[standalone@localhost:9999 type=threading] :read-attribute(name=thread-count)

{
"outcome" => "success",
"result" => 39
}

[standalone@localhost:9999 /] /core-service=platform-mbean/type=threading:read-resource

{
"outcome" => "success",
"result" => {
"all-thread-ids" => [
102L,
101L,
100L,
99L,
…생략 …
3L,
2L
],
"thread-contention-monitoring-supported" => true,
"thread-cpu-time-supported" => true,
"current-thread-cpu-time-supported" => true,
"object-monitor-usage-supported" => true,
"synchronizer-usage-supported" => true,
"thread-contention-monitoring-enabled" => false,
"thread-cpu-time-enabled" => true,
"thread-count" => 38,
"peak-thread-count" => 81,
"total-started-thread-count" => 95L,
"daemon-thread-count" => 13,
"current-thread-cpu-time" => 0L,
"current-thread-user-time" => 0L
}
}

런타임 상황

JBoss EAP 6의 기본 정보 및 가동 상태 정보를 수집할 수 있다. ‘/core-service=platform-mbean/type=runtime’에서 확인할 수 있는 것은 Java Runtime 정보와 클래스 패스, 시스템 프로퍼티 등 Java 실행환경에 대한 정보들이다.

옵션설명CLI 명령
name호스트 이름
[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=name)

{
"outcome" => "success",
"result" => "29268@opennaru"
}

| vm-name | Java VM 이름 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=vm-name)

{
"outcome" => "success",
"result" => "Java HotSpot(TM) 64-Bit Server VM"
}

| vm-vendor | Java VM 업체 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=vm-vendor)

{
"outcome" => "success",
"result" => "Sun Microsystems Inc."
}

| vm-version | Java VM 버전 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=vm-version)

{
"outcome" => "success",
"result" => "20.45-b01"
}

| spec-name | 표준 이름 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=spec-name)

{
"outcome" => "success",
"result" => "Java Virtual Machine Specification"
}

| spec-vendor | 표준 벤더 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=spec-vendor)

{
"outcome" => "success",
"result" => "Sun Microsystems Inc."
}

| spec-version | 표준 버전 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=spec-version)

{
"outcome" => "success",
"result" => "1.0"
}

| management-spec-version | Management 표준 버전 | |

[standalone@localhost:9999 /] /core-service==platform-mbean/type=runtime:read-attribute(name=management-spec-version)

{
"outcome" => "success",
"result" => "1.2"
}

| class-path | 클래스 패스 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=class-path)

{
"outcome" => "success",
"result" => "/products/test/jbossEAP61/jboss-eap-6.1/jboss-modules.jar"
}

| library-path | 라이브러리 패스 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=library-path)

{
"outcome" => "success",
"result" => "/usr/java/jdk1.6.0_45/jre/lib/amd64/server:/usr/java/jdk1.6.0_45/jre/lib/amd64:/usr/java/jdk1.6.0_45/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib"
}

| boot-class-path | 부트 클래스 패스 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=boot-class-path)

{
"outcome" => "success",
"result" => "/usr/java/jdk1.6.0_45/jre/lib/resources.jar:/usr/java/jdk1.6.0_45/jre/lib/rt.jar:/usr/java/jdk1.6.0_45/jre/lib/sunrsasign.jar:/usr/java/jdk1.6.0_45/jre/lib/jsse.jar:/usr/java/jdk1.6.0_45/jre/lib/jce.jar:/usr/java/jdk1.6.0_45/jre/lib/charsets.jar:/usr/java/jdk1.6.0_45/jre/lib/modules/jdk.boot.jar:/usr/java/jdk1.6.0_45/jre/classes"
}

| input-arguments | Java VM Arguments | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=input-arguments)

{
"outcome" => "success",
"result" => [
"-D[Standalone]",
"-XX:+UseCompressedOops",
"-Xms1303m",
"-Xmx1303m",
"-XX:MaxPermSize=256m",
"-Djava.net.preferIPv4Stack=true",
"-Djboss.modules.system.pkgs=org.jboss.byteman",
"-Djava.awt.headless=true",
"-Dorg.jboss.boot.log.file=/products/test/jbossEAP61/jboss-eap-6.1/standalone/log/server.log",
"-Dlogging.configuration=file:/products/test/jbossEAP61/jboss-eap-6.1/standalone/configuration/logging.properties"
]

}

| system-properties | 시스템 프로퍼티 | |

[[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)

{
"outcome" => "success",
"result" => {
"[Standalone]" => "",
"catalina.home" => "/products/test/jbossEAP61/jboss-eap-6.1/standalone/tmp",
"file.encoding" => "UTF-8",
"jboss.bind.address.management" => "0.0.0.0",
"jboss.home.dir" => "/products/test/jbossEAP61/jboss-eap-6.1",
… 생략 …
"user.home" => "/products/test/jbossEAP 61",
"user.language" => "ko",
"user.name" => "jboss",
"user.timezone" => "ROK"
}
}

| start-time | JBoss 실행 시간 | |

[standalone@localhost:9999 /] /core-service=platform-mbean/type=runtime:read-attribute(name=start-time)

{
"outcome" => "success",
"result" => 1386029233021L
}

데이터소스

JBoss EAP 6 데이터소스 서브시스템의 연결 풀의 상황을 /subsystem=datasources/data-source=<데이터소스명>/statistics=pool:read-resource(include-runtime=true, include-defaults=true) 에서 확인할 수 있다.

다음 예제는 CLI로 ExampleDS 의 데이터소스 접속 풀의 런타임 정보를 얻는 것이다.

[standalone@localhost:9999 /] /subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime=true,include-defaults=true)

{
"outcome" => "success",
"result" => {
"ActiveCount" => "0",
"AvailableCount" => "20",
"AverageBlockingTime" => "0",
"AverageCreationTime" => "0",
"CreatedCount" => "0",
"DestroyedCount" => "0",
"InUseCount" => "0",
"MaxCreationTime" => "0",
"MaxUsedCount" => "0",
"MaxWaitCount" => "0",
"MaxWaitTime" => "0",
"TimedOut" => "0",
"TotalBlockingTime" => "0",
"TotalCreationTime" => "0"
}
}

데이터소스 정보의 주요 속성값은 다음 표와 같다.

속성설명
ActiveCount현재 사용 중인 연결 개수
AvailableCount사용 가능한 연결 개수
AverageBlockingTime연결을 위해서 대기했던 평균 시간(ms)
AverageCreationTime데이터베이스와 연결에 걸린 평균 시간(ms)
CreatedCount지금까지 만들어진 연결 개수
DestroyedCount지금까지 소멸된 연결 개수
MaxCreationTime데이터베이스와 연결에 걸린 최대 시간(ms)
MaxUsedCount지금까지 동시에 사용된 최대 연결수
MaxWaitCount연결을 얻기 위해 대기한 스레드의 최댓값
MaxWaitTime연결을 얻기 위해 대기한 대기 시간의 최댓값
TimedOut접속을 얻기 위해 기다리다 타임아웃된 스레드의 개수
TotalBlockingTime연결을 위해 블록킹했던 시간의 총합
TotalCreationTime연결을 생성하기 위해 걸린 시간의 총합

표 4. 데이터소스 정보의 주요 속성값

AJP 커넥터

웹 애플리케이션의 동작 상태를 모니터링하기 위해서는 웹 서브 시스템의 접속상황 정보를 확인하면 된다. 웹 서브시스템은 커넥터를 제공하는데 웹 서버를 통해 요청을 받고 있다면, AJP 커넥터의 정보를 확인하면 된다.

‘/subsystem=web/connector=ajp:read-resource(include-runtime=true)’에서 실행 중인 JBoss EAP 6 서버의 ajp 커넥터 정보를 얻을 수 있다.

http 커넥터를 사용하는 경우 ‘/subsystem=web/connector=http:read-resource(include-runtime=true)’에서 웹 서브시스템의 http 커넥터 정보를 얻을 수 있다.

ajp 커넥터의 주요 속성값은 다음 표와 같다.

속성설명
bytesReceived커넥터가 수신한 바이트 수
bytesSent커넥터가 전송한 바이트 수
enable-lookups서블릿 API에서 DNS를 조회하는지 정보
enabled커넥터를 사용할 것인지 지정
errorCount커넥터에서 요청 처리 시 발생한 에러의 개수
max-connections최대 동시 접속 연결 수
max-post-size컨테이너가 처리 가능한 POST의 최대 크기(bytes)
maxTime요청 처리에 걸린 최대 시간
processingTime커넥터의 처리 시간(ms)
requestCount커넥터가 처리한 요청 개수
bytesReceived커넥터가 받은 메시지의 총 바이트 수
bytesSent커넥터가 전송한 메시지의 총 바이트 수

표 5. AJP 커넥터의 주요 속성값

다음과 같이 CLI로 AJP 커넥터의 런타임 정보를 얻을 수 있다.

[standalone@localhost:9999 /] /subsystem=web/connector=http:read-resource(include-runtime=true)

{
"outcome" => "success",
"result" => {
"bytesReceived" => "0",
"bytesSent" => "0",
"configuration" => undefined,
"enable-lookups" => false,
"enabled" => true,
"errorCount" => "0",
"executor" => undefined,
"max-connections" => undefined,
"max-post-size" => 2097152,
"max-save-post-size" => 4096,
"maxTime" => "0",
"name" => "http",
"processingTime" => "0",
"protocol" => "HTTP/1.1",
"proxy-name" => undefined,
"proxy-port" => undefined,
"redirect-port" => 443,
"requestCount" => "0",
"scheme" => "http",
"secure" => false,
"socket-binding" => "http",
"ssl" => undefined,
"virtual-server" => undefined
}
}

EJB

EJB3 서브시스템에서 EJB실행시 사용되는 스레드 풀에 대한 정보를 얻을 수 있다. 또, EJB의 모니터링 항목으로는 빈 인스턴스 풀의 런타임 정보도 중요하다. 이 정보는 배포된 EJB에서 수집할 수 있다. 사용방법은 ‘배포된 애플리케이션 모니터링’에서 설명한다.

  • EJB3의 스레드 풀

‘/subsystem=ejb3/thread-pool=default:read-resource(include-runtime=true)’에서 JBoss EAP 6 EJB3 서브시스템의 스레드 풀 정보를 수집할 수 있다. EJB3의 스레드 풀의 주요 속성값은 다음 표와 같다.

속성설명
active-count실행 중인 스레드 수
completed-task-count실행이 완료한 작업의 수
current-thread-count풀의 현재 스레드 수
largest-thread-count현재까지 풀에 있었던 스레드의 최대 개수
max-threads풀의 최대 스레드 수
rejected-count거부된 작업의 개수
task-count지금까지 실행된 태스크의 총 개수

표 6. EJB3 default스레드 풀의 주요 속성값

아래와 같이 CLI로 EJB3의 default 스레드 풀의 런타임 정보를 얻을 수 있다.

[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=default:read-resource(include-runtime=true)

{
"outcome" => "success",
"result" => {
"active-count" => 0,
"completed-task-count" => 0L,
"current-thread-count" => 0,
"keepalive-time" => {
"time" => 100L,
"unit" => "MILLISECONDS"
},
"largest-thread-count" => 0,
"max-threads" => 10,
"name" => "default",
"queue-size" => 0,
"rejected-count" => 0,
"task-count" => 0L,
"thread-factory" => undefined
}
}

트랜잭션

트랜잭션 서브시스템에서는 트랜잭션의 런타임 정보를 얻을 수 있다.

‘/subsystem=transactions:read-resource(include-runtime=true)’에서 JBoss EAP 6 서버의 트랜잭션 서브 시스템의 트랜잭션 정보를 수집할 수 있다. 트랜잭션 정보의 주요 속성값은 다음 표와 같다.

속성설명
default-timeout기본 타임아웃값
number-of-aborted-transactions중지(롤백)된 트랜잭션 수
number-of-application-rollbacks애플리케이션의 요청에 따라 롤백 된 트랜잭션 수
number-of-committed-transactions완료된 트랜잭션 수
number-of-heuristics휴리스틱으로 종료한 트랜잭션 수
number-of-inflight-transactions시작하여 아직 종료되지 않은 트랜잭션 수
number-of-nested-transactions중첩된(서브) 트랜잭션 수
number-of-resource-rollbacks자원의 문제로 롤백 된 트랜잭션 수
number-of-timed-out-transactions타임아웃 때문에 롤백 된 트랜잭션의 수
number-of-transactions작성된 트랜잭션의 총 개수(중첩된 트랜잭션 포함)

표 7. 트랜잭션 정보 주요 속성값

다음과 같이 CLI로 트랜잭션의 런타임 정보를 얻을 수 있다.

[standalone@localhost:9999 /] /subsystem=transactions:read-resource(include-runtime=true)

{
"outcome" => "success",
"result" => {
"default-timeout" => 300,
"enable-statistics" => false,
"enable-tsm-status" => false,
"jdbc-action-store-drop-table" => false,
"jdbc-action-store-table-prefix" => undefined,
"jdbc-communication-store-drop-table" => false,
"jdbc-communication-store-table-prefix" => undefined,
"jdbc-state-store-drop-table" => false,
"jdbc-state-store-table-prefix" => undefined,
"jdbc-store-datasource" => undefined,
"jts" => false,
"node-identifier" => "1",
"number-of-aborted-transactions" => 0L,
"number-of-application-rollbacks" => 0L,
"number-of-committed-transactions" => 0L,
"number-of-heuristics" => 0L,
"number-of-inflight-transactions" => 0L,
"number-of-nested-transactions" => 0L,
"number-of-resource-rollbacks" => 0L,
"number-of-timed-out-transactions" => 0L,
"number-of-transactions" => 0L,
"object-store-path" => "tx-object-store",
"object-store-relative-to" => "jboss.server.data.dir",
"path" => "var",
"process-id-socket-max-ports" => 10,
"process-id-uuid" => true,
"recovery-listener" => false,
"relative-to" => "jboss.server.data.dir",
"socket-binding" => "txn-recovery-environment",
"status-socket-binding" => "txn-status-manager",
"use-hornetq-store" => false,
"use-jdbc-store" => false,
"log-store" => {"log-store" => undefined}
}
}

배포된 애플리케이션 모니터링

  • 애플리케이션의 세션 상황

/deployment=<애플리케이션명>.war/subsystem=web:read-resource(include-runtime=true)에서 JBoss EAP 6 서버에 배포된 애플리케이션의 세션 상태 정보를 얻을 수 있다.

속성설명
active-sessions사용 중인 세션 수
duplicated-session-ids랜덤 소스에 의해 생성된 중복 세션 ID의 개수
expired-sessions타임아웃에 의해 종료된 세션의 수
max-active-sessions사용중인 세션 수의 최대 수
rejected-sessions작성 가능한 세션 수 상한에 도달했기 때문에 세션 작성을 거절한 횟수
session-avg-alive-time세션이 유지된 평균 시간. 단위:초
session-max-alive-time세션이 유지된 최대 시간. 단위:초
sessions-created세션 관리자(Manager)가 생성한 세션의 총 개수

표 8. 애플리케이션 세션 상태 주요 속성값

다음과 같이 CLI로 웹 애플리케이션의 세션 상태 런타임 정보를 수집할 수 있다.

[standalone@127.0.0.1:9999 deployment] /deployment=helloejb.war/subsystem=web:read-resource(include-runtime=true)

{
"outcome" => "success",
"result" => {
"active-sessions" => 0,
"context-root" => "/helloejb",
"duplicated-session-ids" => 0,
"expired-sessions" => 0,
"max-active-sessions" => 0,
"rejected-sessions" => 0,
"session-avg-alive-time" => 0,
"session-max-alive-time" => 0,
"sessions-created" => 0,
"virtual-host" => "default-host",
"servlet" => {"com.opennaru.wstest.Hello" => undefined}
}
}
  • EJB3의 인스턴스 풀 상황

/deployment=<애플리케이션명>.war/ ejb3/stateless-session-bean=<EJB명>:read-resource(include-runtime=true)에서 JBoss EAP 6 서버에 배포된 EJB의 인스턴스 풀 정보를 얻을 수 있다.

속성설명
pool-available-count사용 가능한 인스턴스 풀의 개수
pool-create-count생성된 인스턴스의 총 개수
pool-current-size현재 풀의 크기
pool-max-size풀의 최대 크기
pool-remove-count풀에서 제거된 인스턴스 개수

표 9. EJB3 인스턴스 풀의 주요 속성값

다음과 같이 CLI로 EJB3의 인스턴스 풀의 런타임 정보를 수집할 수 있다.

[standalone@127.0.0.1:9999 deployment] /deployment=helloejb.war/subsystem=ejb3/stateless-session-bean=HelloStateless:read-resource(include-runtime=true)

{
"outcome" => "success",
"result" => {
"component-class-name" => "HelloStateless",
"declared-roles" => [],
"execution-time" => 0L,
"invocations" => 0L,
"methods" => {},
"peak-concurrent-invocations" => 0L,
"pool-available-count" => 20,
"pool-create-count" => 0,
"pool-current-size" => 0,
"pool-max-size" => 20,
"pool-name" => "slsb-strict-max-pool",
"pool-remove-count" => 0,
"run-as-role" => undefined,
"security-domain" => "other",
"timers" => [],
"wait-time" => 0L
}
}