Thread: BUG #1806: Postmaster takes uses 99% of CPU

BUG #1806: Postmaster takes uses 99% of CPU

From
""
Date:
The following bug has been logged online:

Bug reference:      1806
Logged by:
Email address:      m.krueger@chs.de
PostgreSQL version: 7.4.8-0.6
Operating system:   Suse Linux Enterprise Server 9
Description:        Postmaster takes uses 99% of CPU
Details:

The Prozess Postmaster takes 99% of Cpu.

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
20726 postgres  17   0 19996 5356 4216 R 98.3  0.3  26:36.56 postmaster
19956 postgres  19   0 19996 6148 4936 R 64.4  0.3  28:38.38 postmaster
20005 postgres  24   0 19996 6244 5068 R 23.6  0.3  36:25.35 postmaster
19955 postgres  22   0 20060 6364 5156 R 10.3  0.3  34:25.64 postmaster
20014 postgres  17   0 19992 5264 4136 R  5.6  0.3  15:17.95 postmaster
10454 tomcat    25   0  608m 426m  12m S  0.3 21.1  12:47.47 java

I have read all the Faq. But there is no reason to it.
Could you help?

Re: BUG #1806: Postmaster takes uses 99% of CPU

From
Richard Huxton
Date:
m.krueger@chs.de wrote:
> The Prozess Postmaster takes 99% of Cpu.
>
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 20726 postgres  17   0 19996 5356 4216 R 98.3  0.3  26:36.56 postmaster
> 19956 postgres  19   0 19996 6148 4936 R 64.4  0.3  28:38.38 postmaster
...
> I have read all the Faq. But there is no reason to it.
> Could you help?

Is it doing anything?
Do your logs show any activity?
If you do "strace -p <pid>" as root, you'll see what system calls the
backend is making.

--
   Richard Huxton
   Archonet Ltd

Re: BUG #1806: Postmaster takes uses 99% of CPU

From
Richard Huxton
Date:
Mike Kr=FCger wrote:
> Sorry, I lost the Email Adress of the List.

No problem, just remember to hit "reply all" rather than "reply".

> There are no problems with other Processes.
> The System is only slow, when the postmaster Prozess gets the 100 % CPU t=
ime.
> Can I configure it, that this Prozess dont get more than 60 % ?

Not really (on Linux anyway). However, if other processes have useful=20
work to do and need CPU time, they will get their fair share. So - if PG=20
is running at 99% CPU (for long periods) that implies all other=20
processes are either waiting for PG to respond anyway, or are waiting=20
for disk/network etc.

The system shouldn't feel "slow" or "unresponsive" just because one=20
process is busy. If it does, that might imply swap is being used, or=20
network or disk activity is at a maximum.

General system admin is too large a subject to deal with here, but the=20
tools to check documentation for are: top/free/vmstat/iostat/netstat

Oh - and make sure your configuration settings are reasonable. Read=20
these two performance-tuning guides:
  http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php
  http://www.powerpostgresql.com/PerfList

HTH
--
   Richard Huxton
   Archonet Ltd