You can use the thread pool and connection pool monitoring feature to view metrics of the thread pool and connection pool of an application that is monitored by Application Real-Time Monitoring Service (ARMS). The provided metrics include the number of core threads, number of existing threads, maximum number of allowed threads, number of active threads, number of submitted tasks, and maximum number of tasks allowed in the task queue.
Prerequisites
Your application is monitored by ARMS. For more information, see Overview.
Only Application Monitoring Pro Edition supports the thread pool and connection pool monitoring feature.
Enable thread pool and connection pool monitoring
The ARMS agent earlier than V2.7.1.3 does not support thread pool and connection pool monitoring. Upgrade the agent version to 2.7.1.3 or later. For more information, see Upgrade the ARMS agent.
By default, thread pool and connection pool monitoring is enabled for the ARMS agent V2.7.3.5 and later.
If you are using the ARMS agent V2.7.1.3 or later, perform the following operations to manually enable thread pool and connection pool monitoring:
Log on to the ARMS console. In the left-side navigation pane, choose .
On the Application List page, select a region in the top navigation bar and click the name of the application that you want to manage.
NoteIf the icon is displayed in the Language column, the application is connected to Application Monitoring. If a hyphen (-) is displayed, the application is connected to Managed Service for OpenTelemetry.
In the left-side navigation pane, click Application Settings.
Click the Custom Configuration tab. On the Custom Configuration tab, turn on Thread pool, connection pool monitoring in the Advanced Settings section.
View metrics
After you enable the thread pool and connection pool monitoring feature, you can view the metrics on the Thread pool monitoring and Connection pool monitoring tabs of the Application Details page.
Frameworks supported by thread pool monitoring
ARMS agent V4.1.x and later
The ARMS agent V4.1.x and later supports the following frameworks:
java.util.ThreadPoolExecutor: Apache Tomcat 8 to 9.1, Apache Dubbo, High-speed Service Framework (HSF), Vert.x, and user-defined thread pools.
org.apache.tomcat.util.threads.ThreadPoolExecutor: Tomcat 9.1 +.
org.eclipse.jetty.util.thread.QueuedThreadPool: Jetty.
org.xnio.XnioWorker: Undertow.
The following metrics are collected.
Metric name | Framework | Description |
arms_thread_pool_core_pool_size |
| The number of core threads, which remains unchanged. |
arms_thread_pool_max_pool_size |
| The maximum number of threads, which remains unchanged. |
arms_thread_pool_active_thread_count |
| The number of active threads, that is, the number of threads with tasks being executed. |
arms_thread_pool_current_thread_count |
| The current number of threads, including the number of active threads and the number of threads that are waiting for task execution. |
arms_thread_pool_max_thread_count |
| The maximum historical number of threads in the thread pool. |
arms_thread_pool_scheduled_task_count |
| The number of tasks scheduled in the thread pool. |
arms_thread_pool_completed_task_count |
| The number of tasks executed in the thread pool. |
arms_thread_pool_rejected_task_count |
| The number of rejected tasks in the thread pool. |
arms_thread_pool_queue_size |
| The size of the task queue in the thread pool. |
ARMS agent earlier than V4.1.x
The ARMS agent earlier than V4.1.x supports the Apache Tomcat, HSF, Apache Dubbo, Vert.x, and Undertow frameworks. Among the ARMS agent versions, V3.1.x and earlier support Undertow V1.x and V2.x, whereas V3.2.x and later support all Undertow versions.
The following metrics are collected.
Metric description | Metric name |
Number of core threads in the thread pool | arms_threadpool_core_size |
Maximum number of threads in the thread pool | arms_threadpool_max_size |
Number of active threads in the thread pool | arms_threadpool_active_size |
Thread pool queue size | arms_threadpool_queue_size |
Current size of the thread pool | arms_threadpool_current_size |
The ARMS agent earlier than V4.1.x supports the SchedulerX framework. The following metric is collected.
Metric description | Metric name |
Number of active threads in the thread pool | arms_threadpool_active_size |
Frameworks supported by connection pool monitoring
ARMS agent V4.1.x and later
The ARMS agent V4.1.x and later supports the following frameworks: DBCP ( > 2.0), Vibur DBCP ( > 11.0), c3p0 ( > 0.9.2), Apache Druid, HikariCP ( > 3.0), Jedis ( > 3.0), Lettuce ( > 5.0), and Redisson ( > 3.0).
The following metrics are collected.
Metric name | Framework | Description |
arms_connection_pool_connection_count | DBCP, c3p0, Vibur DBCP, Druid, HikariCP, Jedis, Lettuce, and Redisson | The number of connections. Connection have two states: Active and Idle. |
arms_connection_pool_connection_min_idle_count | DBCP, Jedis, Druid, HikariCP, and Lettuce | The minimum number of idle connections, which remains unchanged. |
arms_connection_pool_connection_max_idle_count | DBCP, Jedis, Druid, and Lettuce | The maximum number of idle connections, which remains unchanged. |
arms_connection_pool_connection_max_count | DBCP, Druid, Vibur DBCP, and HikariCP | The maximum number of idle connections, which remains unchanged. |
arms_connection_pool_pending_request_count | c3p0, HikariCP, and Jedis | The number of blocked connection requests. |
ARMS agent earlier than V4.1.x
The ARMS agent earlier than V4.1.x supports the OkHttp2 and OkHttp3 frameworks. The following metrics are collected.
Metric description | Metric name |
Number of active connections in the connection pool | arms_threadpool_active_size |
Number of current connections in the connection pool | arms_threadpool_current_size |
The ARMS agent earlier than V4.1.x supports the Apache HttpClient framework. The following metrics are collected.
Metric description | Metric name |
Number of current connections in the connection pool | arms_threadpool_current_size |
Maximum number of connections in the connection pool | arms_threadpool_max_size |
Number of waiting queues in the connection pool | arms_threadpool_queue_size |
The ARMS agent earlier than V4.1.x supports the Apache Druid framework. The following metrics are collected.
Metric description | Metric name |
Number of active connections in the connection pool | arms_threadpool_active_size |
Maximum number of connections in the connection pool | arms_threadpool_max_size |
The ARMS agent earlier than V4.1.x supports the HikariCP framework. The following metrics are collected.
Metric description | Metric name |
Number of active connections in the connection pool | arms_threadpool_active_size |
Maximum number of connections in the connection pool | arms_threadpool_max_size |