pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: jf <jfmeteo@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: increased load on server
Date: Fri, 11 Feb 2011 16:32:10 -0600
Message-ID: <4D55648A020000250003A8DA@gw.wicourts.gov> (raw)
In-Reply-To: <AANLkTi=rYsHh4nJJPJ283WRa92BbhfsUzn03RM_PeYoE@mail.gmail.com>
References: <AANLkTi=rYsHh4nJJPJ283WRa92BbhfsUzn03RM_PeYoE@mail.gmail.com>

jf <jfmeteo@gmail.com> wrote:
 
> I tried to tune posgresql.conf to use more memory.
 
Right before the problems started?  As an attempt to deal with the
problems?  Years ago?
 
> In two years on production everything was fine, but today
> something goes wrong: postgresql processes eat my server
> ressources, my load, which was between 0 and 2.5 on my 4 cpus
> server, grows to 20.
 
The output from `vmstat 1` during such an episode might be
enlightening.
 
> When the trouble appends there was a lot of waiting queries on my
> ltree table.
 
Waiting where?  Are you talking about executing queries which are
blocked trying to acqure locks on the ltree table?
 
> I tried to restart postgresql server and to reboot the server, but
> 5 minutes later, the trouble was here again.
 
Any idea what changed during those 5 minutes?
 
> I did a backup/restore of my database (pg_dump -Fc / pg_restore),
> and it was fine for 2 hours but after the touble reappears.
 
Did you notice anything about the usage during those two hours?  Did
you take a close look at what queries were being run when things are
OK versus when they are not?
 
> I notice that the "base" directory grows a lot when the trouble
> begins. I made a 'vacuum', 'vacuum analyze', 'vacuum full' but the
> disk usage isn't lower.
 
Hopefully you are running autovacuum.  VACUUM FULL is normally not a
good idea in 8.3.  What you might want to look for is a lingering
transaction which is preventing normal autovacuum from working. 
Does anything show if you select from pg_prepared_xacts?  Are there
any rows in pg_stat_activity with a xact_start value older than it
should be?  One connection sitting in status '<IDLE> in transaction'
for a long time can cause all sorts of problems.
 
If these hints don't point you in the right direction, please review
this page for ideas on more information you can supply to help
people understand the problem and its cause:
 
http://wiki.postgresql.org/wiki/Guide_to_reporting_problems
 
In particular, knowing your exact PostgreSQL version, the contents
of your postgresql.conf file (minus all comments), the number of
connections you have active during the problem periods, and (if
possible) listings of pg_stat_activity and pg_locks during a problem
episode.
 
-Kevin



view thread (5+ messages)  latest in thread

Message-ID: <4D55648A020000250003A8DA@gw.wicourts.gov>
Permalink:  ../4D55648A020000250003A8DA@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4D55648A020000250003A8DA@gw.wicourts.gov

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, jfmeteo@gmail.com
  Subject: Re: increased load on server
  In-Reply-To: <4D55648A020000250003A8DA@gw.wicourts.gov>
  References: <AANLkTi=rYsHh4nJJPJ283WRa92BbhfsUzn03RM_PeYoE@mail.gmail.com> <4D55648A020000250003A8DA@gw.wicourts.gov>

* 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