[imp] Slow response on IMP

Rich Lafferty rich@horde.org
Mon, 20 Aug 2001 16:14:53 -0400


On Mon, Aug 20, 2001 at 09:04:10PM +0100, Anil Madhavapeddy (anil@recoil.org) wrote:
> On Mon, Aug 20, 2001 at 11:40:18PM +0800, imp@gurubase.com wrote:
> > 
> > We suspected that it may be related to the horde session.  Could anyone
> > help?
> > 
> > We encounter four situation when the response is slow and we find that
> > at that moment the CPU utlization is very high for the PostgreSQL process.
> > 
> > 1. when loading the index.php3.
> > 2. after pressing "log in" button.
> > 3. after pressing "compose" button.
> > 4. after pressing "logout" button.
> > 
> 
> It's hard to tell where the slowness without some more information.
> Can you profile the Postgres process to find out which queries are
> taking up so much CPU?

My first suspicion is that the databases aren't being VACUUMed
regularly. Handy test -- if 

  SELECT count(*) FROM active_sessions;

takes more than a few seconds, you need to VACUUM. Just

  VACUUM; VACUUM ANAYLZE;

(which might take a while in which the table being VACUUMed will be
locked) and all should be back to normal.

We run VACUUM nightly, with about 1000 sessions/day.

  -Rich

-- 
Rich Lafferty --------------+-----------------------------------------------
 Montreal, Quebec, Canada   |  Save the Pacific Northwest Tree Octopus!
 http://www.lafferty.ca/    |    http://zapatopi.net/treeoctopus.html
rich@lafferty.ca -----------+-----------------------------------------------