You can use Work Managers to prioritize work based on rules that you define and by monitoring actual run time performance statistics to then optimize the performance of your applications.
Work Managers can be applied globally to a WebLogic Server domain.
A Work Manager defines a set of request classes and thread constraints that manage work performed by WebLogic Server.
A request class defines a fair share thread entitlement, a response time goal, or a context policy for a particular class of application request.
Thread constraints define the maximum number of threads to allocate for requests, the minimum number of threads to use for resolving deadlocks, and the total number of requests that can be queued or running before WebLogic Server begins rejecting requests.
See Using Work Managers to Optimize Scheduled Work in Administering Server Environments for Oracle WebLogic Server.
You can create global Work Managers that are used to prioritize thread execution.
In the Edit Tree, go to Scheduling, then Work Managers.
Click New.
Enter a name for the new Work Manager and click Create.
Update the default values as appropriate.
On the Targets tab, select the servers or clusters on which you plan to deploy applications that reference the Work Manager and move them under Chosen. Move unwanted servers or clusters under Available.
Click Save.
Next, you must create at least one request class or constraint. The global Work Manager uses request classes and constraints to determine how to prioritize work. See Create Request Classes and Create Constraints.
Request classes express a scheduling guideline that WebLogic Server uses to allocate threads to requests.
In the Edit Tree, go to Scheduling, then choose one of the request class types:
Click New.
Enter a name for the new request class and, for Response Time request classes, update the Response Time Goal value.
Click Create.
On the Targets tab, select the servers or clusters on which you plan to deploy applications that reference this request class and move them under Chosen.
The servers or clusters that you select must share at least one target with the applicable Work Manager.
Click Save.
Next, you must assign this request class to a Work Manager to use it. See Assign a Request Class or Constraints to a Work Manager.
A constraint defines the minimum and maximum numbers of threads allocated to execute requests and the total number of requests that can be queued or executing before WebLogic Server begins rejecting requests.
In the Edit Tree, go to Scheduling, then choose one of the constraint types:
Click New.
Enter a name for the new constraint and click Create.
Update the default values for the constraint as necessary. Click Save when you are done with your changes.
On the Targets tab, select the servers or clusters on which you plan to deploy applications that reference this constraint and move them under Chosen.
The servers or clusters that you select must share at least one target with the applicable Work Manager.
Click Save.
Repeat to add another type of constraint, if necessary.
Each Work Manager can contain only one constraint of each type.
Next, you must assign this constraint to a Work Manager to use it. See Assign a Request Class or Constraints to a Work Manager.
Before you can use the settings defined in a request class or constraint, you must assign it to a Work Manager.
Request Classes: Each Work Manager can contain only one request class, but you can share request classes among multiple Work Managers.
Constraints: Each Work Manager can contain only one constraint of each type, but you can share constraints among multiple Work Managers.
If you haven’t done so already, create a global Work Manager. See Create a Global Work Manager.
In the Edit Tree, go to Scheduling, then Work Managers and select the Work Manager where you want to assign the request class or constraints.
Use the applicable drop-down lists to choose a request class or constraints to assign to this Work Manager.
Click Save.
You can define how a Work Manager should handle stuck threads.
For more information, see Stuck Thread Handling in Administering Server Environments for Oracle WebLogic Server.
If you haven’t done so already, create a global Work Manager. See Create a Global Work Manager.
In the Edit Tree, go to Scheduling, then Work Managers, then myWorkManager, then Work Manager Shutdown Trigger.
Click Create.
Update the default values as needed.
Click Save.
WebLogic Server provides concurrency capabilities to Jakarta EE applications by using Concurrent Managed Object (CMO) templates to make threads container-managed. You can configure CMO templates and then make them available for use by application components, such as servlets and EJBs.
You can define three types of CMO templates:
For more information, see Configuring Concurrent Managed Objects in Administering Server Environments for Oracle WebLogic Server.
You can create managed executor service (MES) templates that are used by applications to execute submitted tasks asynchronously.
In the Edit Tree, go to Scheduling, then Managed Executor Service Templates.
Click New.
Enter a name for the new MES template.
Click Create.
If you want to use a non-default Work Manager with this MES template, in the Dispatch Policy field, enter the name of the custom Work Manager.
If you want to specify the priority of the long running daemon thread, update the value in the Long Running Threads Priority field.
If you want to define the maximum number of concurrent long-running tasks submitted to this MES template in the domain, update the value in the Max Concurrent Long Running Requests field.
Click Save.
On the Targets tab, select the servers or clusters where this MES template will be accessible and move them under Chosen. Move unwanted servers or clusters under Available.
Only applications that have been deployed to the selected servers and clusters can use this MES template.
Click Save.
You can create managed scheduled executor service (MSES) templates that are used by applications to execute submitted tasks asynchronously at specific times.
In the Edit Tree, go to Scheduling, then Managed Scheduled Executor Service Templates.
Click New.
Enter a name for the new MSES template.
Click Create.
If you want to use a non-default Work Manager with this MSES template, in the Dispatch Policy field, enter the name of the custom Work Manager.
If you want to specify the priority of the long running daemon thread, update the value in the Long Running Threads Priority field.
If you want to define the maximum number of concurrent long-running tasks submitted to this MSES template in the domain, update the value in the Max Concurrent Long Running Requests field.
Click Save.
On the Targets tab, select the servers or clusters where this MSES template will be accessible and move them under Chosen. Move unwanted servers or clusters under Available.
Only applications that have been deployed to the selected servers and clusters can use this MSES template.
Click Save.
You can create managed thread factory (MTF) templates that are used by applications to create managed threads.
In the Edit Tree, go to Scheduling, then Managed Thread Factory Templates.
Click New.
Enter a name for the new MTF template.
Click Create.
If you want to specify the priority assigned to the thread, update the value in the Priority field. The greater the number, the higher the priority.
If you want to define the maximum number of threads that are created by the MTF and are still executing the run()
method of the tasks, update the value in the Max Concurrent New Threads field.
Click Save.
On the Targets tab, select the servers or clusters where this MTF template will be accessible and move them under Chosen. Move unwanted servers or clusters under Available.
Only applications that have been deployed to the selected servers and clusters can use this MTF template.
Click Save.