Our web-based app suffers occasional dramatic slowdowns which appear to
be due to occasional contention for locked database resources.
I've done the following steps:
1. ps -efl | grep postgres
The output shows a number of connections in transaction, apparently
waiting on one another. Eventually they all clear.
2. psql -c "SELECT * FROM pg_stat_activity" template1
All of the entries have an empty query column.
3. I inspected pg_locks and found two entries:
___Relation____database_transaction__pid ________mode______granted_
(null) (null) 385025 10071 ExclusiveLock true
16757 16977 (null) 10071 AccessShareLock true
I'm trying to understand these results. PID 10071 is a connection from
one of our webservers. But relation 16757 doesn't appear to correspond
to any table in the database.
I don't know how to correspond the transaction id, 385025 with anything.
It certainly doesn't show up in the log file and I have statement
logging turned on.
Ultimately I want to be able to track this back to an offending query or
transaction that has been left open so that we can fix our source code.
How can I get there?
Regards,
--
Frank Kurzawa <fkurzawa@topazsoftware.com>
Topaz Software, Inc.