Creating a new execution thread pool for servlet for WLS 7 and WLS 8
Step 1:
You need to create a new Execute Queue (e.g. CriticalAppQueue)
Step 2:
To enable a separate thread pool, configure the servlet (using web.xml) to use the new Execute Queue:
You need to create a new Execute Queue (e.g. CriticalAppQueue)
- Click the name of the server instance where you will add the execute queue.
- Select the Monitoring
—> General tab. - Click the Monitor All Active Queues text link to display the execute queues that the selected server uses.
- Click the Configure Execute Queue text link to display the execute queues that you can modify.
- Click the Configure a New Execute Queue link.
- On the Execute Queue Configuration tab modify the following attributes or accept the system defaults:
- Queue Length: Always leave the Queue Length at the default value of 65536 entries. The Queue Length specifies the maximum number of simultaneous requests that the server can hold in the queue. The default of 65536 requests represents a very large number of requests; outstanding requests in the queue should rarely, if ever reach this maximum value. If the maximum Queue Length is reached, WebLogic Server automatically doubles the size of the queue to account for the additional work. Note, however, that exceeding 65536 requests in the queue indicates a problem with the threads in the queue, rather than the length of the queue itself; check for stuck threads or an insufficient thread count in the execute queue.
- Queue Length Threshold Percent: Enter the percentage (from 1-99) of the Queue Length size that can be reached before the server indicates an overflow condition for the queue. All actual queue length sizes below the threshold percentage are considered normal; sizes above the threshold percentage indicate an overflow. When an overflow condition is reached, WebLogic Server logs an error message and increases the number of threads in the queue by the value of the Threads Increase attribute to help reduce the workload. By default, the Queue Length Threshold Percent value is 90 percent. In most situations, you should leave the value at or near 90 percent, to account for any potential condition where additional threads may be needed to handle an unexpected spike in work requests. Keep in mind that Queue Length Threshold Percent must not be used as an automatic tuning parameter—the threshold should never trigger an increase in thread count under normal operating conditions.
- Thread Count: Specify the number of threads assigned to this queue. If you do not need to use more than 15 threads (the default) for your work, do not change the value of this attribute.
- Threads Increase: Enter the number of threads WebLogic Server should add to this execute queue when it detects an overflow condition. If you specify zero threads (the default), the server changes its health state to "warning" in response to an overflow condition in the thread, but it does not allocate additional threads to reduce the workload. Note that if WebLogic Server increases the number of threads in response to an overflow condition, the additional threads remain in the execute queue until the server is rebooted. In general, you should monitor the error log to determine the cause of overflow conditions, and reconfigure the thread count as necessary to prevent similar conditions in the future. Do not use the combination of Threads Increase and Queue Length Threshold Percent as an automatic tuning tool; doing so generally results in the execute queue allocating more threads than necessary and suffering from poor performance due to context switching.
- Threads Minimum: Specify the minimum number of threads that WebLogic Server should maintain in this execute queue to prevent unnecessary overflow conditions. By default, the Threads Minimum is set to 5.
- Threads Maximum: Specify the maximum number of threads that this execute queue can have; this value prevents WebLogic Server from creating an overly high thread count in the queue in response to continual overflow conditions. By default, the Threads Maximum is set to 400.
- Thread Priority: Specify the priority of the threads associated with this queue. By default, the Thread Priority is set to 5.
- Click Create to create the new execute queue.
- Reboot the server to use the new settings.
Step 2:
To enable a separate thread pool, configure the servlet (using web.xml) to use the new Execute Queue:
<servlet><servlet-name>SnoopServlet</servlet-name><jsp-file>/myapp/critical.jsp</jsp-file><init-param><param-name>wl-dispatch-policy</param-name><param-value>CriticalAppQueue</param-value></init-param></servlet>
Comments