dbTalk Databases Forums  

Trying to find a renegade lock

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Trying to find a renegade lock in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Frank Kurzawa
 
Posts: n/a

Default Trying to find a renegade lock - 08-24-2004 , 12:47 PM






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 (AT) topazsoftware (DOT) com>
Topaz Software, Inc.


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.