pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
High CPU with 7.4.1 after running for about 2 weeks
4+ messages / 2 participants
[nested] [flat]

* High CPU with 7.4.1 after running for about 2 weeks
@ 2004-03-10 03:43  Mike Bridge <mike@bridgecanada.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Mike Bridge @ 2004-03-10 03:43 UTC (permalink / raw)
  To: pgsql-performance

I've been running Postgresql 7.4.1 for a couple weeks after upgrading
from 7.2.  I noticed today that the postmaster had been using 99% of
the dual CPUs (on a PowerEdge 2650) non-stop for the last couple days.
I stopped all the clients, and it didn't abate---even with no
connections---so I restarted the postmaster.  Now everything is
running smoothly again.

Is there anything that might accumulate after two weeks that might
cause postgresql to thrash?  I'm running pg_autovacuum, so the
database itself should be nice and clean.  It isn't connections,
because I restarted the clients a few times without success.  I've
been running a long time on 7.2 with essentially the same
configuration (minus pg_autovacuum) without any problems....

Thanks for any help,

-Mike



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: High CPU with 7.4.1 after running for about 2 weeks
@ 2004-03-13 23:17  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Mike Bridge <mike@bridgecanada.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2004-03-13 23:17 UTC (permalink / raw)
  To: Mike Bridge <mike@bridgecanada.com>; +Cc: pgsql-performance

Mike Bridge <mike@bridgecanada.com> writes:
> I've been running Postgresql 7.4.1 for a couple weeks after upgrading
> from 7.2.  I noticed today that the postmaster had been using 99% of
> the dual CPUs (on a PowerEdge 2650) non-stop for the last couple days.
> I stopped all the clients, and it didn't abate---even with no
> connections---so I restarted the postmaster.  Now everything is
> running smoothly again.

Since the postmaster is a single unthreaded process, it's quite
impossible for it to take up 100% of two CPUs.  Could you be more
precise about which processes were eating CPU, and what they were
doing according to the available state data?  (ps auxww and
pg_stat_activity can be helpful tools.)

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: High CPU with 7.4.1 after running for about 2 weeks
@ 2004-03-14 03:10  Mike Bridge <mike@bridgecanada.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Mike Bridge @ 2004-03-14 03:10 UTC (permalink / raw)
  To: pgsql-performance

>Since the postmaster is a single unthreaded process, it's quite
>impossible for it to take up 100% of two CPUs.  Could you be more
>precise about which processes were eating CPU, and what they were
>doing according to the available state data?  (ps auxww and
>pg_stat_activity can be helpful tools.)
>
>			regards, tom lane

I shut down all our clients (all java except one in perl), and
pg_stat_activity showed that there was still one query active.  That's
a good table to know about!  Anyway, it didn't end until I sent it a
TERM signal.  I assume this means there's a runaway query somewhere,
which I'll have to hunt down.

But if the client dies, doesn't postgresql normally terminate the
query that that client initiated?  Or do I need to set
statement_timeout?

(As for the 100% CPU, I was confused by the fact that I was getting
two lines in "top" (on Linux) with 99% utilization---I assume with two
runaway queries.)

Thanks for your help!

-Mike






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: High CPU with 7.4.1 after running for about 2 weeks
@ 2004-03-15 21:46  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Mike Bridge <mike@bridgecanada.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2004-03-15 21:46 UTC (permalink / raw)
  To: Mike Bridge <mike@bridgecanada.com>; +Cc: pgsql-performance

Mike Bridge <mike@bridgecanada.com> writes:
> But if the client dies, doesn't postgresql normally terminate the
> query that that client initiated?  Or do I need to set
> statement_timeout?

The backend generally won't notice that the connection is dead until
it next tries to fetch a command from the client.  So if the client
launches a long-running query and then goes away, the query will
normally complete.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-03-15 21:46 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-10 03:43 High CPU with 7.4.1 after running for about 2 weeks Mike Bridge <mike@bridgecanada.com>
2004-03-13 23:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-03-14 03:10   ` Mike Bridge <mike@bridgecanada.com>
2004-03-15 21:46     ` Tom Lane <tgl@sss.pgh.pa.us>

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