The following topic describes the MBeans tab and the recommended number of threads in the pool.
The MBeans tab provides access to the JMX Managed Beans and their available attributes and operations. Of particular interest are the queuedthreadpool instances that are available within the org.eclipse.jetty.util.thread bean. For example, instance 0 represents the thread pool that handles runtime requests. When you click the Attributes item for instance 0, the current state of the thread pool is displayed.
The number of threads in the pool (the
threads attribute) can be compared to
the number of threads that are not currently in use (the
attribute). Ideally, a sufficient number of threads is available to handle load spikes
that occur during peak usage times, while also limiting the number of idle threads that
are running. If the thread pool is too small, requests might be blocked. If the thread
pool is too large, memory might be used unnecessarily, and CPU contention might
increase, limiting the processing effectiveness.
We recommend allowing for 10 to 25% more threads than are typically active while the system executes a normal or expected load. Because most of your users will not be active at the same time, set the minimum threads to 10% above the average number of active threads that are observed during monitoring.
We also recommend setting the maximum number of threads to 25% above the average number of active threads that are observed while monitoring under expected load conditions. Make certain to weigh this recommendation against the observed CPU utilization metrics and the suggestions in the Performance Tuning Guide.