Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: CPU bound a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 13 Topic 4010 of 4424
Post > Topic >>

Re: CPU bound at 99%

by erik@[EMAIL PROTECTED] (Erik Jones) Apr 22, 2008 at 10:55 AM

On Apr 22, 2008, at 10:31 AM, Bryan Buecking wrote:

> Hi,
>
> I'm running into an performance problem where a Postgres db is running
> at 99% CPU (4 cores) with about 500 concurrent connection doing=20=20
> various
> queries from a web application. This problem started about a week ago,
> and has been steadily going downhill. I have been tweaking the=20=20
> config a
> bit, mainly shared_memory but have seen no noticeable improvements.
>
> at any given time there is about 5-6 postgres in startup
> (ps auxwww | grep postgres | grep startup | wc -l)
>
> about 2300 connections in idle
> (ps auxwww | grep postgres | idle)
>
> and loads of "FATAL: sorry, too many clients already" being logged.
>
> The server that connects to the db is an apache server using=20=20
> persistent
> connections. MaxClients is 2048 thus the high number of connections
> needed. Application was written in PHP using the Pear DB class.

Are you referring to PHP's persistent connections?  Do not use
those.=20=20=
=20
Here's a thread that details the issues with why not: 
http://archives.post=
gresql.org/pgsql-general/2007-08/msg00660.php=20
..  Basically, PHP's persistent connections are NOT pooling
solution.=20=20=
=20
Us pgpool or somesuch.

<snip>

>
> max_connections =3D 2400

That is WAY too high.  Get a real pooler, such as pgpool, and drop=20=20
that down to 1000 and test from there.  I see you mentioned 500=20=20
concurrent connections.  Are each of those connections actually
doing=20=20
something?  My guess that once you cut down on the number actual=20=20
connections you'll find that each connection can get it's work done=20=20
faster and you'll see that number drop significantly.  For example,=20=20
our application does anywhere from 200 - 600 transactions per
second,=20=20
dependent on the time of day/week, and we never need more that 150
to=20=20
200 connections (although we do have the max_connections set to 500).

<snip>

Erik Jones

DBA | Emma=AE
erik@[EMAIL PROTECTED]
 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com




--=20
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 13 Posts in Topic:
CPU bound at 99%
buecking@[EMAIL PROTECTED  2008-04-23 00:31:01 
Re: CPU bound at 99%
jd@[EMAIL PROTECTED] (&q  2008-04-22 08:41:09 
Re: CPU bound at 99%
buecking@[EMAIL PROTECTED  2008-04-23 00:56:46 
Re: CPU bound at 99%
erik@[EMAIL PROTECTED] (  2008-04-22 10:55:19 
Re: CPU bound at 99%
buecking@[EMAIL PROTECTED  2008-04-23 01:10:26 
Re: CPU bound at 99%
buecking@[EMAIL PROTECTED  2008-04-23 01:22:37 
Re: CPU bound at 99%
tgl@[EMAIL PROTECTED] (T  2008-04-22 12:25:36 
Re: CPU bound at 99%
buecking@[EMAIL PROTECTED  2008-04-23 01:16:43 
Re: CPU bound at 99%
ivoras@[EMAIL PROTECTED]   2008-04-23 01:58:47 
Re: CPU bound at 99%
craig@[EMAIL PROTECTED]   2008-04-23 00:36:35 
Re: CPU bound at 99%
haraldarminmassa@[EMAIL P  2008-04-22 18:15:38 
Re: CPU bound at 99%
scott.marlowe@[EMAIL PROT  2008-04-22 10:23:55 
Re: CPU bound at 99%
lists@[EMAIL PROTECTED]   2008-04-22 18:45:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 7:57:22 CST 2008.