11 Scheduling Work
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.
Create a Global Work Manager
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.
Create Request Classes
Request classes express a scheduling guideline that WebLogic Server uses to allocate threads to requests.
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.
Create Constraints
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.
Next, you must assign this constraint to a Work Manager to use it. See Assign a Request Class or Constraints to a Work Manager.
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.
Note:
-
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.
Create a Work Manager Shutdown Trigger
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.
Concurrent Managed Object Templates
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.
- Managed Executor Service Template - Used by applications to execute submitted tasks asynchronously. See Create a Global Managed Executor Service Template.
- Managed Scheduled Executor Service Template - Used by applications to execute submitted tasks asynchronously at specific times. See Create a Global Managed Scheduled Executor Service Template.
- Managed Thread Factory Template - Used by applications to create managed threads. See Create a Global Managed Thread Factory Template.
For more information, see Configuring Concurrent Managed Objects in Administering Server Environments for Oracle WebLogic Server.
Create a Global Managed Executor Service Template
You can create managed executor service (MES) templates that are used by applications to execute submitted tasks asynchronously.