On Thu, 23 Aug 2007 08:29:03 +0400, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
"Max Zorloff" <zorloff@xxxxxxxxx> writes:
... The problem is that after the number of concurrent users rises to
100, CPU becomes almost 100% loaded. How do I find out what's hogging
the
CPU?
'top' shows demon using 8% cpu on top, and some amount of postgres
processes each using 2% cpu with some apache processes occassionally
rising with 2% cpu also. Often the writer process is at the top using
10%
cpu.
IOW there's nothing particular hogging the CPU? Maybe you need more
hardware than you've got, or maybe you could fix it by trying to
optimize your most common queries. It doesn't sound like there'll be
any quick single-point fix though.
There's no one big process chugging everything yes, but all these 2%
postgres
processes look like they're having their hand in overall cpu consumption.
I looked through every query and they all use indexes and whats more,
return
1-20 rows at most. Yes, I think there won't be any fix, but I wanted to
know,
are there some tools or techinques for finding where the problem lies?
I've looked into query time statistics - they all grow with cpu usage but
it
doesn't really mean anything - cpu usage grows, queries get slower.
When one postgres process waits for lock to release does it use any cpu?
And also, when apache waits for query to finish, does it use cpu?
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
message can get through to the mailing list cleanly