Re: How did I get 8 Exclusive locks on the same table? And how many locks is too many? - Mailing list pgsql-general

From Bill Moran
Subject Re: How did I get 8 Exclusive locks on the same table? And how many locks is too many?
Date
Msg-id 20110629163918.34da417b.wmoran@potentialtech.com
Whole thread Raw
In response to How did I get 8 Exclusive locks on the same table? And how many locks is too many?  (Aleksey Tsalolikhin <atsaloli.tech@gmail.com>)
Responses Re: How did I get 8 Exclusive locks on the same table? And how many locks is too many?  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-general
In response to Aleksey Tsalolikhin <atsaloli.tech@gmail.com>:
>
>   We use the fine Bucardo check_postgres Nagios plugin,
> and it reported a "CRITICAL" level spike in database locks
> (171 locks).
>
> I looked closely at my database logs and found an even bigger spike
> just a few minutes earlier (208 locks).
>
> I saw 8 EXCLUSIVE locks on table X.   All of these queries completed
> within 5 seconds.  (I know that because they do not appear in my
> slow query log.)

What manner did you use to determine this?  It's not possible to have
multiple table-level EXCLUSIVE locks on a single table, since a single
table level EXCLUSIVE lock will cause other lock attempts to block.
However, it's possible to have multiple row-level EXCLUSIVE locks, 1
per row.  Did the mysterious magic that you used to determine that
there were 8 EXCLUSIVE locks tell you whether they were table level
or row level?  If they're table level, then something is wrong either
with PostgreSQL or your magic.  If they're row level, then that's
hardly unusual.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

pgsql-general by date:

Previous
From: Aleksey Tsalolikhin
Date:
Subject: How did I get 8 Exclusive locks on the same table? And how many locks is too many?
Next
From: Jasmin Dizdarevic
Date:
Subject: Re: FOREIGN TABLE with dblink