pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mitch Pirtle <mitchy@spacemonkeylabs.com>
To: jer@highboard.com
Cc: pgsql-admin@postgresql.org
Subject: Re: PosgreSQL hogging resources?
Date: Fri, 20 Feb 2004 13:57:10 -0500
Message-ID: <40365886.8060508@spacemonkeylabs.com> (raw)
In-Reply-To: <FKEOIJEHOIKIOEHCGNCLAEOJEDAA.jer@highboard.com>
References: <FKEOIJEHOIKIOEHCGNCLAEOJEDAA.jer@highboard.com>

Jeremy Smith wrote:

>I have newly installed PostgreSQL onto my server, the server's main function
>is to serve up a fantasy football site that has a tremendous number of
>queries per page.  Right now with very low traffic I am seeing a server load
>of 2.0+.  That got me a little concerned, so I looked at "top" and noticed
>that postgres is taking anywhere from 60 - 100 percent of my CPU at any
>given time.  There are also 116 sleeping processes out of 123.  This all
>seems very bad, do you guys have any idea what might be causing it or how it
>can be addressed?  How do I go about cleaning out the sleeping processes?
>
I agree with Lamar's comments, as well as wondering if it is really 
needed to run a 'tremendous number of queries' for each page view...  
Some quick solutions could be to determine if you could:

1) make changes to your design to require fewer hits to the database per 
page,
2) make a view that provided the information without running so many 
separate queries, and/or
3) consider using a caching library like ADOdb to limit the number of 
trips to your database

Any combination of these three could significantly reduce the load on 
your DB box, as well as provide some huge performance gains.  How hard 
is your webserver working?  Are they running on the same box?

-- Mitch




view thread (9+ messages)  latest in thread

Message-ID: <40365886.8060508@spacemonkeylabs.com>
Permalink:  ../40365886.8060508@spacemonkeylabs.com/
Also on:    postgresql.org/message-id/40365886.8060508@spacemonkeylabs.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 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: mitchy@spacemonkeylabs.com, jer@highboard.com
  Subject: Re: PosgreSQL hogging resources?
  In-Reply-To: <40365886.8060508@spacemonkeylabs.com>
  References: <FKEOIJEHOIKIOEHCGNCLAEOJEDAA.jer@highboard.com> <40365886.8060508@spacemonkeylabs.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