Re: PosgreSQL hogging resources?

From: Mitch Pirtle <mitchy(at)spacemonkeylabs(dot)com>
To: jer(at)highboard(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: PosgreSQL hogging resources?
Date: 2004-02-20 18:57:10
Message-ID: 40365886.8060508@spacemonkeylabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeremy Smith 2004-02-20 19:12:19 Re: PosgreSQL hogging resources?
Previous Message scott.marlowe 2004-02-20 18:51:01 Re: PosgreSQL hogging resources?