Re: cpu utilization question

From: "Wright, George" <George(dot)Wright(at)infimatic(dot)com>
To: "ries van Twisk" <pg(at)rvt(dot)dds(dot)nl>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: cpu utilization question
Date: 2008-09-18 15:59:35
Message-ID: 51548D6D5BEB57468163194A8C1A0E980161A542@MAGPTCPEXC02.na.mag-ias.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

We did profile the sql. The stand alone statements generally execute in
less than 30 ms. The clients (not browsers) send very short delimited
text messages to the server. The server parses them and inserts a record
for each message and only returns an HTTP 200, 400 to the client.

I guess my confusion is why such a short message would cause postmaster
to use so much CPU. Several messages may arrive simultaneously and that
many postmasters get kicked off.

We are currently installing the pgpool tool but I was wondering if there
were any other things I could try.

________________________________

From: ries van Twisk [mailto:pg(at)rvt(dot)dds(dot)nl]
Sent: Thursday, September 18, 2008 11:46 AM
To: Wright, George
Subject: Re: [NOVICE] cpu utilization question

On Sep 18, 2008, at 10:09 AM, Wright, George wrote:

We're running Suse 10.2, PG 8.1.5, PHP 5.2.

We're seeing high CPU percentages for multiple instances of postmaster:
15 - 30% for each instance. I realize a new instance is spawned for each
connection that is opened and we have lots of clients sending very small
text messages to our app for which we record a row per message.

We also have other periodic jobs that get kicked off but don't use near
the cpu percentage that postmaster seems to.

Is there a way to minimize postmaster's cpu usage or is there some way
to share that process between requests?

Thx.

You could setup connection pooling for these clients (web clients I
assume),

but be-careful with PHP Persistent connections... they are buggy... I
never used pgPool,

but that might be something you need.

When it comes to solving your high CPU processes you need to take a look
why it's slow.

Use explain analyze as a start...

regards, Ries van Twisk

------------------------------------------------------------------------
-------------------------

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message ries van Twisk 2008-09-18 16:06:01 Re: cpu utilization question
Previous Message Wright, George 2008-09-18 15:09:31 cpu utilization question