Wednesday, January 30, 2013

Oracle ESS Jobs Thread Allocation


Oracle Enterprise Scheduler includes a Request Processor component, which represents a single Managed Server in the Oracle Enterprise Scheduler cluster. Request Processors process job requests, such that job execution is connected to one or more request processors. Oracle Weblogic Server “Work Managers” helps ESS to prioritize work and allocate the threads for job execution, through configuration of a Work Assignment and binding the Work Assignment to a Request Processor.

A little background on how WebLogic Server (WLS) handles requests by assigning them execute threads.  WLS uses the concept of Work Managers to provide applications a way to control thread utilization. Oracle WebLogic Server uses socket muxers, which read messages from the network, bundle them into a package of work, and queue them to the Work Manager. The Work Manager then finds a thread on which to execute the work and makes sure the response gets back to the same socket from which the request came. WLS uses a single thread pool, in which all types of work are executed. The server prioritizes work based on rules you define, and run-time metrics, including the actual time it takes to execute a request and the rate at which requests are entering and leaving the pool.

Creating a Work Assignment is fundamental to understanding how threads are allocated to ESS job request execution and how you can limit the period during which job requests of a certain type can be processed.


      Figure: Binding Work Assignments EssWA1 and EssWA2 to ESS Managed Servers

A work assignment includes two primary components that define Request Processor constraints:
  • Specialization Rules: Define restrictions for job request processing on a request processor.
  • Workshifts: Specify temporal windows for processing job requests and thus describe the schedule for when job requests can be processed on a request processor
This combination of Work Assignment controls, including Specialization rules and Workshifts gives you the ability to select the kinds of job requests to be processed and decide how to allocate the request processor resources. For example, you can define two Workshifts: a day shift and a night shift to allocate processing for these periods. The day shift could have more resources allocated for a peak usage period while the night shift could provide a different mix for its resource allocation.

Here is a simple example on how Work Assignments can be used for 4 concurrent ESS SubRequests. This assumes that all SubRequests use the same job definition and that job definition is not used for any other purpose.
  • Create Schedule for appropriate time period.
  • Create Workshift with 4 threads that use the Schedule.
  • Create Work Assignment specialized to that job definition, and add Workshift.
  • Bind Work Assignment to one server in exclusive mode.
Please refer the official Oracle ESS/Fusion Applications Administrators Guide for more details on managing ESS Work Assignments and Workshifts.