very high CPU usage in "top", but not in "mpstat"

From: "Cyrille Bonnet" <cyrille(at)3months(dot)com>
To: <pgsql-performance(at)postgresql(dot)org>
Subject: very high CPU usage in "top", but not in "mpstat"
Date: 2004-05-04 23:34:41
Message-ID: 47E18B2A3472@3months.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello all,

We are using Postgres 7.3 with JBoss 3.2.3 on a Linux Fedora 1.0 box.

When I am looking at CPU activity with "top", I often see something like:

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND

14154 postgres 25 0 3592 3592 2924 R 99.1 0.3
93:53 0 postmaster

At the same time, "mpstat" gives me something like:

11:27:21 AM CPU %user %nice %system %idle intr/s

11:27:21 AM all 2.99 0.00 18.94 78.08 105.94

The system is not visibly slow and response time is satisfactory. Sometimes,
the CPU usage drops to 1 or 2%, but not for long usually. Also I have
checked the number of open connections to Postgres and there are only 5
(maximum is set to the default: 32).

Should I be worried that Postgres is eating up 99% of my CPU??? Or is this
*expected* behaviour?

Please note that I am a developer, not a system administrator, so maybe I
misunderstand the usage of "top" here.

Any help will be appreciated.

Cyrille.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-05-05 13:03:15 Re: very high CPU usage in "top", but not in "mpstat"
Previous Message Greg Stark 2004-05-04 22:15:25 Re: Horribly slow hash join