Re: deadlocks

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Felipe Schnack <felipes(at)ritterdosreis(dot)br>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: deadlocks
Date: 2003-06-20 01:01:59
Message-ID: 20030620010156.GA23144@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 17, 2003 at 06:10:06PM -0300, Felipe Schnack wrote:
> Hi all!

> I'm having a very strange deadlock problem in PostgreSQL 7.3.2 under
> RedHat Linux. All connections to this database come from Tomcat's 4.1.24
> connection pooling mechanism, and for some reason frequently I have lots
> of INSERTs in "waiting" state. But what they're writing for?? To me
> seems one insert is waiting for the other one... anyone have tips on how
> can I find what's my problem? Here is a listing I got on my server using
> "ps -ax |grep post"

See those "idle in transactions"? A client should try to avoid sitting in a
transaction and it could hold up other transactions (presumably what the
INSERTs are doing). If you have a query log, lookup the queries executed in
the idle ones to see when the holdup is.

> 30132 ? S 0:01 postgres: postgres w2 192.168.5.54 INSERT waiting
> 30133 ? S 0:01 postgres: postgres w2 192.168.5.54 idle in transactio
> 30145 ? S 0:00 postgres: postgres w2 192.168.5.54 idle in transactio
> 30168 ? S 0:00 postgres: postgres w2 192.168.5.54 INSERT waiting
> 30180 ? S 0:00 postgres: postgres w2 192.168.5.54 INSERT waiting
> 30183 ? S 0:01 postgres: postgres w2 192.168.5.54 idle
> 30184 ? S 0:00 postgres: postgres w2 192.168.5.54 idle
> 30185 ? S 0:00 postgres: postgres w2 192.168.5.54 INSERT waiting

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
> - Samuel P. Huntington

In response to

  • deadlocks at 2003-06-17 21:10:06 from Felipe Schnack

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Nuzum 2003-06-20 01:09:03 Re: Incremental backups, and backup history
Previous Message Jonathan Ellis 2003-06-20 00:26:38 Tuning question: WAL disk a bottleneck?