Re: Strange performance degradation

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Lorenzo Allegrucci <lorenzo(dot)allegrucci(at)forinicom(dot)it>
Cc: pgsql-performance(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Strange performance degradation
Date: 2009-11-23 21:05:17
Message-ID: 20091123160517.a63d3da4.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

In response to Lorenzo Allegrucci <lorenzo(dot)allegrucci(at)forinicom(dot)it>:

> Tom Lane wrote:
> > Lorenzo Allegrucci <lorenzo(dot)allegrucci(at)forinicom(dot)it> writes:
> >> So, my main question is.. how can just a plain simple restart of postgres
> >> restore the original performance (3% cpu time)?
> >
> > Are you killing off any long-running transactions when you restart?
>
> After three days of patient waiting it looks like the common
> '<IDLE> in transaction' problem..
>
> [sorry for >80 cols]
>
> 19329 ? S 15:54 /usr/lib/postgresql/8.3/bin/postgres -D /var/lib/postgresql/8.3/main -c config_file=/etc/postgresql/8.3/main/postgresql.conf
> 19331 ? Ss 3:40 \_ postgres: writer process
> 19332 ? Ss 0:42 \_ postgres: wal writer process
> 19333 ? Ss 15:01 \_ postgres: stats collector process
> 19586 ? Ss 114:00 \_ postgres: forinicom weadmin [local] idle
> 20058 ? Ss 0:00 \_ postgres: forinicom weadmin [local] idle
> 13136 ? Ss 0:00 \_ postgres: forinicom weadmin 192.168.4.253(43721) idle in transaction
>
> My app is a Django webapp, maybe there's some bug in the Django+psycopg2 stack?
>
> Anyway, how can I get rid those "idle in transaction" processes?
> Can I just kill -15 them or is there a less drastic way to do it?

Connections idle in transaction do not cause performance problems simply
by being there, at least not when there are so few.

If you -TERM them, any uncommitted data will be rolled back, which may
not be what you want. Don't -KILL them, that will upset the postmaster.

My answer to your overarching question is that you need to dig deeper to
find the real cause of your problem, you're just starting to isolate it.
Try turning full query logging on and track what those connections are
actually doing.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pedro Doria Meunier 2009-11-23 21:14:19 Re: obtaining ARRAY position for a given match
Previous Message John Oyler 2009-11-23 20:48:06 I need help creating a composite type with some sort of constraints.

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-11-23 21:26:48 Re: Strange performance degradation
Previous Message Jason Dictos 2009-11-23 20:53:10 Best possible way to insert and get returned ids