MBeans in Payara Server

Below is a non-exhaustive list of MBeans which are useful to monitor in Payara Server. Other MBeans not listed show static information or are JDK-specific.

JVM MBeans

Class Loading

In JMX Monitoring logging set the value to java.lang:type=ClassLoading to monitor this MBean

Attribute Description Comment

loadedclass-count

Number of classes currently loaded in the Java virtual machine

totalloadedclass-count

Total number of classes that have been loaded since the Java virtual machine has started execution

unloadedclass-count

Total number of classes unloaded since the Java virtual machine has started execution

Classes are only unloaded from Payara when the application they are in is undeployed.

Compilation

In JMX Monitoring logging set the value to java.lang:type=Compilation to monitor this MBean

Attribute Description Comment

totalcompilationtime-current

Approximate accumulated elapsed time (in milliseconds) spent in compilation

Garbage Collectors

In JMX Monitoring logging set the value to java.lang:type=GarbageCollector,name=collectors-name to monitor this MBean The garbage collector’s name will be one of the following depending on your JDK configuration options:

  • Copy

  • G1 Young Generation

  • G1 Mixed Generation

  • MarkSweepCompact

  • ParNew

  • PS MarkSweep

  • PS Scavenge

Attribute Description Comment

collectioncount-count

Total number of collections that have occurred

The number of times this garbage collector has been called since Payara was started

collectiontime-count

Approximate accumulated collection elapsed time in milliseconds

How much time has been spent on garbage collection since Payara was started

Memory

In JMX Monitoring logging set the value to java.lang:type=Memory to monitor this MBean

Attribute Description Comment

ObjectsPendingFinalization

Approximate number of objects for which finalization is pending

UsedHeapSize

Amount of used memory in bytes

UsedNonHeapSize

Amount of used memory in bytes

Runtime

In JMX Monitoring logging set the value to java.lang:type=Runtime to monitor this MBean.

Attribute Description Comment

uptime-count

Uptime of the Java virtual machine in milliseconds

Thread System

In JMX Monitoring logging set the value to java.lang:type=Threading to monitor this MBean.

Attribute Description Comment

currentthreadcputime

Returns the total CPU time for the current thread in nanoseconds

currentthreadusertime

Returns the CPU time that the current thread has executed in user mode in nanoseconds

daemonthreadcount

Returns the current number of live daemon threads

deadlockedthreads

Finds cycles of threads that are in deadlock waiting to acquire object monitors

Is either a list of deadlocked threads or the sentence "None of the threads are monitor deadlocked."

monitordeadlockedthreads

Finds cycles of threads that are in deadlock waiting to acquire object monitors

Is either a list of deadlocked threads or the sentence "None of the threads are monitor deadlocked."

peakthreadcount

Returns the peak live thread count since the Java virtual machine started or peak was reset

threadcount

Returns the current number of live threads including both daemon and non-daemon threads

totalstartedthreadcount

Returns the total number of threads created and also started since the Java virtual machine started

Payara MBeans

These MBeans are part of Payara and provide additional information about current usage. They are all in the form of amx:pp=amx:pp=/mon/server-mon[instance-name],type=type-of-mbean,name=MBeanName where instance-name is replaced by the name of the instance i.e. amx:pp=/mon/server-mon[server],type=web-request-mon,name=web/request. See Viewing JMX Monitoring Data for how to view all available MBeans.

Payara MBeans are only available when AMX is booted. This is done automatically once a JMX client connects. For all other cases, AMX must be either configured to boot at server startup (through domain config) or booted via a JMX operation bootAMX on the amx-support:type=boot-amx MBean using a non-JMX client (e.g. over a local socket). Programmatic activation during application deployment (by means of a Startup EJB singleton for example) will not work.

Connection Queue

Network Connection Queue Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=connection-queue-mon,name=network//connection-queue to use this MBean. To monitor a specific network connection set the name value to be network/name-of-listener/connection-queue i.e. name=network/http-listener-1/connection-queue.

Attribute Description Comment

peakqueued

Largest number of connections that were in the queue simultaneously

countoverflows

Number of times the queue has been too full to accommodate a connection

counttotalconnections

Total number of connections that have been accepted

countopenconnections

The number of open/active connections

countqueued

Number of connections currently in the queue

countqueued1minuteaverage

Average number of connections queued in the last 1 minute

countqueued5minutesaverage

Average number of connections queued in the last 5 minutes

countqueued15minutesaverage

Average number of connections queued in the last 15 minutes

counttotalqueued

Total number of connections that have been queued

Connector Service

Connector Container Work Management Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=connector-service-mon,name=jms-service/work-management to monitor this MBean.

Attribute Description Comment

activeworkcount

Number of active work objects

workrequestwaittime

Wait time of a work object before it gets executed

waitqueuelength

Number of work objects waiting in the queue for execution

rejectedworkcount

Number of work objects rejected by the application server

submittedworkcount

Number of work objects submitted by a connector module for execution

completedworkcount

Number of work objects completed execution

Deployment

Deployment Module Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=deployment-mon,name=deployment/lifecycle to monitor this MBean.

Attribute Description Comment

activeapplicationsdeployedcount

Number of applications deployed

totalapplicationsdeployedcount

Total number of applications ever deployed

This does not persist across restarts

EJB Security

EJB Security Deployment statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=ejb-security-mon,name=security/ejb to monitor this MBean.

Attribute Description Comment

policyconfigurationcount

Count of EJB policy configurations

securitymanagercount

Count of EJB security managers

Thread Pool Executor

ThreadPoolExecutor Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=exec-pool-mon,name=ejb/default-exec-pool to monitor this MBean.

Attribute Description Comment

corenumthreads

Core number of threads in the associated pool

maxnumthreads

Maximum number of threads in the associated pool

numthreads

Current number of threads in the associated pool

activenumthreads

Number of active threads in the associated pool

totaltaskscreated

Number of tasks created in the associated pool

keepalivetime

Keep-Alive time for threads in the associated pool

numtaskscompleted

Number of tasks completed in the associated pool

largestnumthreads

Largest number of simultaneous threads in the associated pool

JDBC Connection Pool

JDBC Connection Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=jdbc-connection-pool-mon,name=resources/NameOfPool to monitor this MBean, replacing NameOfPool to whatever the actual name of the pool is i.e. DerbyPool.

Attribute Description Comment

numconncreated

The number of physical connections that were created since the last reset

numconndestroyed

Number of physical connections that were destroyed since the last reset.

numconnfree

The total number of free connections in the pool as of the last sampling

numpotentialconnleak

Number of potential connection leaks

numconnfailedvalidation

The total number of connections in the connection pool that failed validation from the start time until the last sample time

connrequestwaittime

The longest and shortest wait times of connection requests. The current value indicates the wait time of the last request that was serviced by the pool.

Unit is milliseconds

numconnacquired

Number of logical connections acquired from the pool

numconnreleased

Number of logical connections released to the pool

averageconnwaittime

Average wait-time-duration per successful connection request

Unit is milliseconds

numconnsuccessfullymatched

Number of connections successfully matched

numconnnotsuccessfullymatched

Number of connections rejected during matching

waitqueuelength

Number of connection requests in the queue waiting to be serviced

numconntimedout

The total number of connections in the pool that timed out between the start time and the last sample time

Keep Alive

Keep-Alive Statistics

This MBean is for network connections in keep-alive mode. For more details on keep-alive see RFC 7230 6.3. As of HTTP 1.1 all connections are keep-alive unless declared otherwise.

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=keep-alive-mon,name=network//keep-alive to use this MBean. To monitor a specific network connection set the name value to be network/name-of-listener/keep-alive i.e. name=network/http-listener-1/keep-alive.

Attribute Description Comment

counttimeouts

Number of keep-alive connections that timed out

counthits

Number of requests received by connections in keep-alive mode

countconnections

Number of connections in keep-alive mode

countflushes

Number of keep-alive connections that were closed

countrefusals

Number of keep-alive connections that were rejected

Managed Executor Service

ManagedExecutorService Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=managed-executor-service-mon,name=executorService/concurrent/NameOfManagedExecutorService to use this MBean, replacing NameOfManagedExecutorService to whatever the actual name of the service is i.e. __defaultManagedExecutorService.

Attribute Description Comment

PoolSize

The current number of threads in the pool

ActiveCount

The approximate number of active threads

CompletedTaskCount

Number of tasks completed

LargestPoolSize

The largest number of threads that have ever simultaneously been in the pool

TaskCount

The number of tasks executed by the executor service

Message Driven Beans

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=message-driven-bean-mon,name=applicationName/ClassUsingBean to use this MBean, replacing applicationName with the name of your application using JMS and ClassUsingBean with the class that has the @MessageDriven annotation on it.

Attribute Description Comment

createcount

Number of times EJB create method is called

removecount

Number of times EJB remove method is called

messagecount

Number of messages received for the message-driven bean

Request

Web Container HTTP Service Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=request-mon,name=http-service/VirtualServer/request to use this MBean, replacing VirtualServer name of the virtual server it is running on. This MBean differs from Connection Queue statistics by being selected by virtual server rather than by listener, as well as providing some additional information about responses.

Attribute Description Comment

method

The method of the last request serviced

This will be one of GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT or PATCH

countopenconnections

The number of open connections

Unlike most other attributes with count in the name, this one is the current number rather than total over the server lifetime

countrequests

The number of requests received

The number of requests received since the server was started

uri

The URI of the last request serviced

maxtime

Longest response time for a request; not a cumulative value, but the largest response time from among the response times

count200

Number of responses with a status code equal to 200

This is the total since the server started

count2xx

Number of responses with a status code in the 2xx range

This is the total since the server started

count302

Number of responses with a status code equal to 302

This is the total since the server started

count304

Number of responses with a status code equal to 304

This is the total since the server started

count3xx

Number of responses with a status code in the 3xx range

This is the total since the server started

count400

Number of responses with a status code equal to 400

This is the total since the server started

count401

Number of responses with a status code equal to 401

This is the total since the server started

count403

Number of responses with a status code equal to 403

This is the total since the server started

count404

Number of responses with a status code equal to 404

This is the total since the server started

count4xx

Number of responses with a status code in the 4xx range

This is the total since the server started

count503

Number of responses with a status code in the 5xx range

This is the total since the server started

countother

Number of responses with a status code outside the 2xx, 3xx, 4xx, and 5xx range

This is the total since the server started

countbytestransmitted

The number of bytes transmitted

countbytesreceived

The number of bytes received

errorcount

Cumulative value of the error count, with error count representing the number of cases where the response code was greater than or equal to 400

processingtime

Average request processing time

Unit is milliseconds

Security Realm

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=security-realm-mon,name=security/realm to use this MBean.

Attribute Description Comment

RealmCount

Security Realm Count

Server

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=server-runtime-mon to use this MBean.

Attribute Description Comment

state

state of the server such as Running, Stopped, Failed

uptime

uptime of the Java virtual machine in milliseconds

Servlet

Web Container Servlet Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=servlet-mon,name=ApplicationName/InstanceName/ServletName to use this MBean, where ApplicationName is the name of your application and InstanceName is the instance it is running. This MBean provides information on all servlets within an application.

Attribute Description Comment

totalservletsloadedcount

Total number of Servlets ever loaded

activeservletsloadedcount

Number of Servlets loaded

servletprocessingtimes

Cumulative Servlet processing times

Unit is milliseconds

Web Container Servlet Instance Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=servlet-instance-mon,name=ApplicationName/VirtualServerName/ServletName to use this MBean, where ApplicationName is the name of your application, VirtualServerName is the virtual server it is running on and ServletName is the name of the servlet to access. If the servlet is annotation with @WebServlet(name = "ServletName") then the servlet name will be the name in the annotation, otherwise it is the fully qualified class name.

Attribute Description Comment

errorcount

Number of error responses (that is, responses with a status code greater than or equal to 400)

requestcount

Number of requests processed

processingtime

Average response time

Unit is milliseconds

maxtime

Maximum response time

Unit is milliseconds

servicetime

Aggregate response time

Singleton Bean

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=singleton-bean-mon,name=ApplicationsName/ClassName where ApplicationName is the name of your application and ClassName of the name of the Singleton EJB class.

Attribute Description Comment

createcount

Number of times EJB create method is called

removecount

Number of times EJB remove method is called

Stateful Bean

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=stateful-bean-mon,name=ApplicationsName/ClassName where ApplicationName is the name of your application and ClassName of the name of the Stateful EJB class.

Attribute Description Comment

createcount

Number of times EJB create method is called

removecount

Number of times EJB remove method is called

methodreadycount

Number of stateful session beans in MethodReady state

passivecount

Number of stateful session beans in Passive state

Stateless Bean

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=stateless-bean-mon,name=ApplicationsName/ClassName where ApplicationName is the name of your application and ClassName of the name of the Stateless EJB class.

Attribute Description Comment

createcount

Number of times EJB create method is called

removecount

Number of times EJB remove method is called

methodreadycount

Number of stateful session beans in MethodReady state

Thread Pool

Thread Pool Statistics

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=thread-pool-mon,name=network/NetworkListenerName/thread-pool where NetworkListenerName is the name of the network listener to monitor. Alternatively set the value to amx:pp=/mon/server-mon[server],type=thread-pool-mon,name=network//global-thread-pool-stats for totals across all thread pools.

Attribute Description Comment

corethreads

Core number of threads in the thread pool

totalexecutedtasks

Provides the total number of tasks, which were executed by the thread pool

maxthreads

Maximum number of threads allowed in the thread pool

currentthreadcount

Provides the number of request processing threads currently in the listener thread pool

currentthreadsbusy

Provides the number of request processing threads currently in use in the listener thread pool serving requests

Transaction Service

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=transaction-service-mon,name=transaction-service to use this MBean.

Attribute Description Comment

activecount

Provides the number of transactions that are currently active.

committedcount

Provides the number of transactions that have been committed.

rolledbackcount

Provides the number of transactions that have been rolled back.

state

Indicates if the transaction service has been frozen.

Returns false if service is working fine

Virtual Server

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=virtualserverinfo-mon,name=http-service/VirtualServerName where VirtualServerName is the name of the virtual server.

Attribute Description Comment

id

The id of the virtual server

hosts

The host (alias) names of the virtual server"

mode

The mode of the virtual server

Is either active or unknown

state

The state of the virtual server

Web Request

In JMX Logging set value to amx:pp=/mon/server-mon[server],type=web-request-mon,name=ApplicationName/VirtualServer where ApplicationName is the name of your application and VirtualServer is the name of the virtual server it is running on. There is also the special value of web/request for all requests to every virtual server and application.

Attribute Description Comment

errorcount

Cumulative value of the error count, with error count representing the number of cases where the response code was greater than or equal to 400

requestcount

Cumulative number of requests processed so far

processingtime

Average request processing time

maxtime

Longest response time for a request; not a cumulative value, but the largest response time from among the response times

OpenMQ MBeans

Payara Server includes OpenMQ as a JMS broker, which includes its own MBeans. Documentation on them can be found in the official GlassFish reference guide for coding JMX clients. Check section 3: Message Queue MBean Reference