DB2 Version 10.1 for Linux, UNIX, and Windows

Setting a CPU limit

Set the CPU limit attribute using the CREATE SERVICE CLASS statement to create a new service class and CPU limit, and use the ALTER SERVICE CLASS statement to alter the CPU limit setting for an existing service class. You set the CPU limit to cap CPU utilization by a service class under all circumstances during workload management dispatcher control.

Before you begin

You must enable the workload management dispatcher by configuring the wlm_dispatcher database manager configuration parameter, if not already done. By enabling the workload management dispatcher, CPU resource control using the CPU limit attribute becomes available by default. See: Enabling workload management dispatcher.

About this task

The CPU limit is set for a service class in this task using the CREATE SERVICE CLASS or ALTER SERVICE CLASS statement using the command line processor.

Restrictions

You can assign CPU limits only to service classes that the workload management dispatcher can control, which are user and maintenance service classes. The CPU resource allocations for system service classes cannot be controlled by the workload management dispatcher.

Procedure

To create a new service class and set the CPU limit (skip to step 2 if an existing service class CPU limit setting is to be altered):

  1. Issue the CREATE SERVICE CLASS statement to create a new service class and set the CPU limit to 25% in this example:
    create service class service-class-name cpu limit 25

To alter the CPU limit setting for an existing service class:

  1. Issue the ALTER SERVICE CLASS statement to alter the CPU limit to 50% in this example:
    alter service class service-class-name cpu limit 50

Results

You have set or altered the CPU limit setting for the specified service class. The workload management dispatcher cannot allocate CPU resources to this service class beyond the set limit.

What to do next

After having enabled the workload management dispatcher to manage CPU resources and having set the CPU limit, consider completing the following tasks: