Constraints Understanding Work Managers

Using Work Managers to Optimize Scheduled Work 2-5 context-case user-namesystemuser-name request-class-namehigh_fairsharerequest-class-name context-case context-case group-nameeveryonegroup-name request-class-namelow_fairsharerequest-class-name context-case context-request-class work-manager

2.2.2 Constraints

A constraint defines 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. You can define the following types of constraints: ■ max-threads-constraint—Limits the number of concurrent threads executing requests from the constrained work set. The default is unlimited. For example, consider a constraint defined with maximum threads of 10 and shared by 3 entry points. The scheduling logic ensures that not more than 10 threads are executing requests from the three entry points combined. You can define a max-threads-constraint in terms of a the availability of the resource that requests depend upon, such as a connection pool. A max-threads-constraint might, but does not necessarily, prevent a request class from taking its fair share of threads or meeting its response time goal. Once the constraint is reached the server does not schedule requests of this type until the number of concurrent executions falls below the limit. The server then schedules work based on the fair share or response time goal. ■ min-threads-constraint—Guarantees the number of threads the server will allocate to affected requests to avoid deadlocks. The default is zero. A min-threads-constraint value of one is useful, for example, for a replication update request, which is called synchronously from a peer. A min-threads-constraint might not necessarily increase a fair share. This type of constraint has an effect primarily when the server instance is close to a deadlock condition. In that case, the constraint will cause WebLogic Server to schedule a request even if requests in the service class have gotten more than its fair share recently. ■ capacity—Causes the server to reject requests only when it has reached its capacity. The default is -1. Note that the capacity includes all requests, queued or executing, from the constrained work set. Work is rejected either when an individual capacity threshold is exceeded or if the global capacity is exceeded. This constraint is independent of the global queue threshold. Note: If a Web applications Work Manager references a context request class, the first user call will go through the default request class; subsequent calls in same session will go through the user-defined request class. When using context request classes, set session timeout values to prevent sessions from expiring while requests wait in the Work Manager queue. 2-6 Configuring Server Environments for Oracle WebLogic Server

2.2.3 Stuck Thread Handling