pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Brian Cox <brian.cox@ca.com>
Cc: Tom Lane [tgl@sss.pgh.pa.us] <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: multiple threads inserting into the same table
Date: Mon, 23 Mar 2009 14:38:52 -0600
Message-ID: <dcc563d10903231338y38879310j438eb07b64593c42@mail.gmail.com> (raw)
In-Reply-To: <49C7F050.7030505@ca.com>
References: <49C7F050.7030505@ca.com>

On Mon, Mar 23, 2009 at 2:25 PM, Brian Cox <brian.cox@ca.com> wrote:
> Tom Lane [tgl@sss.pgh.pa.us] wrote:
>>
>> pg_stat_activity says those five threads are doing nothing except
>> sitting around with open transactions.  You sure you don't have a bug on
>> the application side?
>>
>>                        regards, tom lane
>
> This is a java app. A thread dump reveals that these 5 threads are all
> asleep on a socket read to postgres (see below). DbUtils.java:2265 is:
>
> session.connection().createStatement() .executeUpdate(((DatabaseInsert)
> insertObject).getInsertStmt(session));
>
> This generates and executes a single SQL insert. Since, as you point out,
> postgres seems to think that this transaction isn't doing anything,
> it's hard to figure out what the read is doing.

Might you have a firewall that's killing the connections?  What does
netstat -an on the client side say about these connections?



view thread (9+ messages)  latest in thread

Message-ID: <dcc563d10903231338y38879310j438eb07b64593c42@mail.gmail.com>
Permalink:  ../dcc563d10903231338y38879310j438eb07b64593c42@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10903231338y38879310j438eb07b64593c42@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: scott.marlowe@gmail.com, brian.cox@ca.com, tgl@sss.pgh.pa.us
  Subject: Re: multiple threads inserting into the same table
  In-Reply-To: <dcc563d10903231338y38879310j438eb07b64593c42@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox