The timeout value is actually set in the IRLMRWT parameter, in seconds. That 
tells Db2 how long a lock wait can last until it takes action and cancels the 
waiting thread.

The values on the proc are about lock wait detection. IRLM checks every given 
time if there is any thread waiting for a lock. The first figure in the DEADLOK 
parm (poor naming choice if you ask me) tells IRLM how often the check is 
happening. A value below 100 is assumed to be in seconds, above 100 is in 
miliseconds. The second figure tells IRLM how many check cycles are to happen 
(with that same lock wait still standing) until a lock wait situation is 
acknowledged for that thread.
https://www.ibm.com/docs/en/db2-for-zos/13.0.0?topic=commands-start-irlmproc-zos-irlm

After that and only after that, the timeout set in IRLMRWT starts counting.

In your case that would be one cycle of 5 seconds for detection, then let's say 
30 seconds (IRLMRWT value) until actual timeout.


Depending on the shop and its particular needs you can play with those 3 
numbers, being aware of the gaps: an error margin of up to 4.9 seconds where a 
lock wait situation might exist without being detected yet. Plus if my memory 
serves, when those 30 IRLMRWT seconds are exhausted, Db2 will stiil wait for 
the next IRLM check cycle (could be up to another 4.9 extra time) to confirm 
the lock wait is still there, and *then* take action.


As usual there are no 'correct' numbers, it just depends. I have seen banking 
shops with heavy online transaction activity set everything so the maximum 
overall lock wait time allowed would be no more than 5 seconds, detection 
included. In case a locking problem happens, they would happily take a bunch of 
timeout-cancelled threads instead of having a growing transaction queuing issue 
that would build up really fast to the point of overflowing their application 
servers and create an ever bigger problem. Of course, different shops with 
different workloads and priorities could use totally different parm numbers.


BTW, I see that starting in Db2 13 level 500 a new special register can be used 
to set tailored timeout values (not detection values) at the application level. 
Pretty useful.
https://www.ibm.com/docs/en/db2-for-zos/13.0.0?topic=registers-current-lock-timeout



Hope this helps,

Jaime F.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to