Skip site navigation (1) Skip section navigation (2)

Exclusive lock question

From: Emil Briggs <emil(at)baymountain(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Exclusive lock question
Date: 2005-06-29 15:08:28
Message-ID: 200506291108.28516.emil@baymountain.com (view raw or flat)
Thread:
Lists: pgsql-performance
I have been trying to diagnose a performance problem we have been seeing with 
a postgres application. The performance of the database server is usually 
quite good but every now and then it slows to a crawl. The output of vmstat 
does not show excessive CPU usage or disk IO. The output of ps does show that 
the number of postgres process's that appear to be stuck in some query spikes 
and in some cases restarting the postgres server is the only way to clear 
them. While trying to diagnose this problem I ran

select * from pg_locks

I could understand most of the output but I was wondering what a result like 
the following indicates

 relation | database | transaction |  pid  |     mode      | granted
----------+----------+-------------+-------+---------------+---------
          |          |    26052434 | 29411 | ExclusiveLock | t
          |          |    26051641 | 29345 | ExclusiveLock | t
          |          |    26052415 | 29519 | ExclusiveLock | t
          |          |    26052407 | 29381 | ExclusiveLock | t
          |          |    26052432 | 29658 | ExclusiveLock | t

When I see the slowdowns there are hundreds of these with no entry for 
relation or database. Any ideas what is being locked in this case?

Emil

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2005-06-29 15:27:47
Subject: Re: Exclusive lock question
Previous:From: Michael FuhrDate: 2005-06-29 12:50:22
Subject: Re: Postgresql7.4.5 running slow on plpgsql function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group