Resource assignment with service classes
A service class defines an execution environment in which work can run. This execution environment allocates available resources and can include thresholds that determine how work is permitted to run.
In the previous figure, the activities in both service superclasses are further subdivided. The service class provides a two-tier hierarchy: a service superclass and service subclasses underneath. This hierarchy permits for a more complex division of execution environment and better emulates a real-world model. Unless specified otherwise, service subclasses inherit characteristics from the service superclass. Use the service subclasses to further subdivide work in the service superclass.
Prioritization and resource control
Control | Description |
---|---|
Soft resource shares | Use this control to compute a soft resource entitlement for the service class. The soft entitlement is the maximum resources the service class is allowed when resources are under competition. A soft entitlement may be exceeded when there is spare resource capacity (i.e. other service classes are not using their full resource entitlement). |
Hard resource shares | Use this control to compute a hard resource entitlement for the service class. The hard entitlement is the maximum amount of resources the service class is allowed. |
Minimum resource share | Use this control to indicate a percentage of the entitled resources that are held in reserve for the service class (i.e. minimum resource allocation). |
CPU limits | Use this control to limit the amount of CPU that work running in a service class is allowed to use. |
CPU shares |
Use this to determine the distribution of CPU resources between service classes. This is based on the amount of CPU shares given to all service classes and the amount of work running there. |
Prefetch priority | Use this control to assign a priority to the prefetch requests, which affects the order in which they are addressed by the data server. |
Buffer pool priority | Use this control to assign a buffer pool priority to service classes which affects how likely pages fetched by activities in a service class are to be swapped out. |
Outbound correlator | Use this control to permit a workload to have some of its
resources controlled by an external workload manager such as AIX® Workload Manager or Linux® workload management. The
agent passes the outbound correlator to the external workload manager, which uses it to map the
workload to one of the external workload manager's resource groups. Note: This control cannot be set
when agent priority is in use.
When Db2® workload management
is used in conjunction with an external workload manager, additional controls are available.
|
Service subclasses
Although the service superclass is the highest tier for work, activities run only in service subclasses. Each service superclass has a default service subclass defined to run activities that you do not assign to an explicitly defined subclass. This default subclass is created when the service superclass is created. You can create additional subclasses in a service class as you require them to further isolate work. Except for histograms and the COLLECT ACTIVITY DATA, COLLECT AGGREGATE ACTIVITY DATA and COLLECT AGGREGATE REQUEST DATA options, a service subclass inherits the attributes of its service superclass, unless otherwise specified. The resources of the superclass are shared by all subclasses in it.
You can define only a single level of subclasses (that is, you cannot define a subclass under another subclass, only under a service superclass).
As user requests enter the data server, they are identified as belonging to a given workload and assigned to a service superclass or subclass. There are also system requests (for example, prefetches) that run under a special default system service class (SYSDEFAULTSYSTEMCLASS) and maintenance requests that are driven by Db2 (such as an automatic RUNSTATS from the health monitor) that run under a default maintenance service class (SYSDEFAULTMAINTENANCECLASS).
You can view your service classes by querying the SYSCAT.SERVICECLASSES catalog view.