This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

JMX Monitoring

WSO2 ESB exposes a number of management resources as JMX MBeans that can be used for managing and monitoring the running server. These MBeans can be accessed remotely using a JMX client such as JConsole. When WSO2 ESB is starting up, it will display the JMX Service URL in the console as follows.

INFO - JMXServerManager JMX Service URL :         service:jmx:rmi://localhost:11111/jndi/rmi://localhost:9999/jmxrmi

This URL can be used to remotely access the JMX Service exposed by WSO2 ESB. In this guide, we will use JConsole as the JMX client to access this service.

Using JConsole for JMX Monitoring

Start JConsole and enter the above URL as the JMX Service URL. Type "admin" in both username and password fields and click "Connect".

After successfully connecting to the JMX service, click on "MBeans" tab of JConsole to view MBeans exposed by the ESB, which are listed under the org.apache.axis2, org.apache.synapse, and org.wso2.carbon nodes. The following section summarizes the attributes and operations available in MBeans exposed by the WSO2 ESB.

Attributes and Operations of MBeans

Transport-related MBeans

For each transport listener and sender enabled in the ESB, there will be an MBean under org.apache.axis2/Transport node which has following attributes and operations. For example, when http and https transports are enabled following MBeans will be exposed.

  • org.apache.axis2/Transport/nio-http-listener
  • org.apache.axis2/Transport/nio-http-sender
  • org.apache.axis2/Transport/nio-https-listener
  • org.apache.axis2/Transport/nio-https-sender
Attribute/Operation NameDescription
ActiveThreadCountThreads active in this transport listener/sender.
AvgSizeReceivedAverage size of received messages.
AvgSizeSentAverage size of sent messages.
MaxSizeReceivedMaximum message size of received messages.
MaxSizeSentMaximum message size of sent messages.
MinSizeReceivedMinimum message size of received messages.
MinSizeSentMinimum message size of sent messages.
MessagesReceivedTotal number of messages received through this transport.
MessagesSentTotal number of messages sent through this transport.
FaultsReceivingNumber of faults encountered while receiving.
FaultsSendingNumber of faults encountered while sending.
BytesReceivedNumber of bytes received through this transport.
BytesSentNumber of bytes sent through this transport.
QueueSizeNumber of messages currently queued. Messages get queued if all the worker threads in this transport thread pool are busy.
ResponseCodeTableNumber of messages sent against their response codes.
TimeoutsReceivingMessage receiving timeout.
TimeoutsSendingMessage sending timeout.
LastResetTimeLast time transport listener/sender statistic recording was reset.
MetricsWindowTime difference between current time and last reset time in milliseconds.
resetStatistics()Clear recorded transport listener/sender statistics and restart recording.
start()Start this transport listener/sender.
stop()Stop this transport listener/sender.
pause()Pause this transport listener/sender which has been started.
resume()Resume this transport listener/sender which is currently paused.
maintenenceShutdown(long gracePeriod)Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenence.

Latency-related MBeans

  • org.apache.synapse/NHTTPLatencyView/nio-http
  • org.apache.synapse/NHTTPLatencyView/nio-https
  • org.apache.synapse/NHTTPS2SLatencyView/nio-http
  • org.apache.synapse/NHTTPS2SLatencyView/nio-https
Attribute/Operation NameDescription
AllTimeAvgLatencyAverage latency since latency recording was last reset.
LastXxxAvgLatencyAverage latency for last Xxx time period. For example, LastHourAvgLatency return the average latency for last hour.
LastResetTimeLast time latency statistic recording was reset.
reset()Clear recorded latency statistics and restart recording.

NttpConnections-related MBeans

  • org.apache.synapse/NhttpConnections/http-listener
  • org.apache.synapse/NhttpConnections/http-sender
  • org.apache.synapse/NhttpConnections/https-listener
  • org.apache.synapse/NhttpConnections/https-sender
Attribute/Operation NameDescription
ActiveConnectionsNumber of currently active connections.
ActiveConnectionsPerHostsA map of number of connections against hosts.
LastXxxConnectionsNumber of connections created during last Xxx time period.
RequestSizesMapA map of number of requests against their sizes.
ResponseSizesMapA map of number of responses against their sizes.
LastResetTimeLast time connection statistic recordings was reset.
reset()Clear recorded connection statistics and restart recording.

Threading-related MBeans

These MBeans are only available in the NHTTP transport and not in the default Pass Through transport.

  • org.apache.synapse/Threading/HttpClientWorker
  • org.apache.synapse/Threading/HttpServerWorker
Attribute/Operation NameDescription
TotalWorkerCountTotal worker threads related to this server/client.
AvgUnblockedWorkerPercentageTime-averaged unblocked worker thread percentage.
AvgBlockedWorkerPercentageTime-averaged blocked worker thread percentage.
LastXxxBlockedWorkerPercentageBlocked worker thread percentage averaged for last Xxx time period.
  
DeadLockedWorkersNumber of deadlocked worker threads since last statistics reset.
LastResetTimeLast time thread statistic recordings was reset.
reset()Clear recorded thread statistic and restart recording.

Proxy service-related MBeans

Navigate to one of the following operations in the org.wso2.carbon/StatisticsAdmin/Operations MBean, type the proxy service name, and press Enter to get statistics for that service:

 

OperationDescription
getServiceRequestCountTotal requests to this service

getServiceFaultCount

Total faults from this service

getServiceResponseCount

Total responses by this service

getMaxServiceResponseTime

Maximum response time by this service

getMinServiceResponseTime

Minimum response time by this service

getAvgServiceResponseTime

Average response time by this service

 

You can also go to org.apache.synapse/StatisticsView/StatisticsView/Operations/getSystemProxyServiceStats to get all of these statistics in a single view.