Calculating wait times for drains

You can calculate how long Db2 waits for drains.

About this task

Begin program-specific programming interface information. A process that requests a drain might wait for two events:

Acquiring the drain lock.
If another user holds the needed drain lock in an incompatible lock mode, then the drainer waits.
Releasing all claims on the object.
Even after the drain lock is acquired, the drainer waits until all claims are released before beginning to process.

If the process drains more than one claim class, it must wait for those events to occur for each claim class that it drains.

Procedure

To calculate the maximum amount of wait time:

  1. Add the wait time for a drain lock and the wait time for claim release.
    Both wait times are based on the timeout period that is calculated by Db2. For the REORG, REBUILD, REBUILD INDEX, CHECK DATA or CHECK LOB utilities, with the SHRLEVEL CHANGE options you can use utility parameters to specify the wait time for a drain lock and to indicate if additional attempts should be made to acquire the drain lock..
    Drainer:
    Each wait time is:
    Utility
    (timeout period) × (value of UTILITY TIMEOUT)
    Other process
    timeout period
  2. Add the wait time for claim release.
  3. Multiply the result by the number of claim classes drained.

Examples

Examples for maximum wait times
Because the maximum wait time for a drain lock is the same as the maximum wait time for releasing claims, you can calculate the total maximum wait time as follows:
For utilities
2 × (timeout period) × (UTILITY TIMEOUT) × (number of claim classes)
For other processes
2 × (timeout period) × (operation multiplier) × (number of claim classes)
For example, suppose that LOAD must drain 3 claim classes, that the timeout period is 20 seconds, and that the value of UTILITY TIMEOUT is 6. Use the following calculation to determine how long the LOAD might utility be suspended before being timed out:
Maximum wait time = 2 × 20 × 6 × 3 = 720 seconds
Wait times less than maximum
The maximum drain wait time is the longest possible time a drainer can wait for a drain, not the length of time it always waits.

For example, The following table lists the steps LOAD takes to drain the table space and the maximum amount of wait time for each step. A timeout can occur at any step. At step 1, the utility can wait 120 seconds for the repeatable read drain lock. If that lock is not available by then, the utility times out after 120 seconds. It does not wait 720 seconds.

Table 1. Maximum drain wait times: LOAD utility
Step Maximum Wait Time (seconds)
1. Get repeatable read drain lock 120
2. Wait for all RR claims to be released 120
3. Get cursor stability read drain lock 120
4. Wait for all CS claims to be released 120
5. Get write drain lock 120
6. Wait for all write claims to be released 120
Total 720

End program-specific programming interface information.