Calculating wait times for drains
You can calculate how long Db2 waits for drains.
About this task
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:
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