Page 1 of 1
Monitoring duration of DB2 deadlocks
Posted: Tue Sep 17, 2019 11:30 am
by awilson
Hi. I'm writing to see if anyone has worked out a way to monitor the duration of DB2 deadlocks. I will test the check_db2_health script on the exchange, but it monitors for deadlocks per second, rather than the duration.
Thanks!
Re: Monitoring duration of DB2 deadlocks
Posted: Tue Sep 17, 2019 2:40 pm
by mbellerue
Putting a monitor on the duration of deadlocks sounds like a great idea. The check_db2_health plugin in the Exchange has a flag for lock-waiting, but lock waits seem like they may be somewhat different from deadlocks...?
I did stumble across this post on Stack Overflow.
https://stackoverflow.com/questions/490 ... ock-in-db2
Specifically, this message.
Yes that means no deadlock. If there was a deadlock and the event monitor was active at the time, then you should see a "Deadlock Event" stanza in the db2evmon output. You can also use the monitoring functions to confirm if a deadlock happened (but not how it happened). The following query reports cumulative values since database-activation:
Code: Select all
SELECT deadlocks, lock_timeouts FROM TABLE (MON_GET_DATABASE(-2));
So it looks like there may be ways to monitor the deadlock event. Maybe they either include duration information, or a way to determine the duration. At which point, you could create a plugin.
Re: Monitoring duration of DB2 deadlocks
Posted: Thu Sep 19, 2019 4:57 pm
by awilson
Thank you very much! I'll try the method mentioned in the article.
Re: Monitoring duration of DB2 deadlocks
Posted: Fri Sep 20, 2019 9:15 am
by mbellerue
Cool! Do you want to leave this thread open, or should we close it?
Re: Monitoring duration of DB2 deadlocks
Posted: Mon Sep 23, 2019 12:31 pm
by awilson
We can close it. Thanks
Re: Monitoring duration of DB2 deadlocks
Posted: Mon Sep 23, 2019 12:32 pm
by scottwilkerson
awilson wrote:We can close it. Thanks
Great!
Locking