pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Idle postmaster taking up a lot of CPU
3+ messages / 2 participants
[nested] [flat]

* Idle postmaster taking up a lot of CPU
@ 2004-01-17 15:34 John Siracusa <siracusa@mindspring.com>
  2004-01-17 17:32 ` Re: Idle postmaster taking up a lot of CPU Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: John Siracusa @ 2004-01-17 15:34 UTC (permalink / raw)
  To: pgsql-performance

Here's the top item from the "top" listing on my Postgres machine:

 10:20am  up 98 days, 18:28,  3 users,  load average: 1.14, 1.09, 0.85
103 processes: 101 sleeping, 1 running, 0 zombie, 1 stopped
CPU0 states: 38.0% user, 13.1% system,  0.0% nice, 48.3% idle
CPU1 states: 39.0% user, 11.3% system,  0.0% nice, 49.1% idle
Mem:  1033384K av, 1021972K used,   11412K free, 0K shrd,   42772K buff
Swap: 1185080K av,   17012K used, 1168068K free            748736K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
20753 postgres  17   0 40292  39M 35960 S    60.9  3.8  26:54 postmaster

Process 20753 was hovering around 60-70% CPU usage for a long time.

I tried to see what that postmaster was doing, but it appeared to be "idle"

% ps -wwwx -p 20753
  PID TTY      STAT   TIME COMMAND
20753 pts/3    R     26:59 postgres: postgres pdm 192.168.0.35 idle

192.168.0.35 is one of our web servers.  I restarted the web server (thus
ending all db connections from that machine) and the "idle-but-CPU-hogging"
postmaster went away.  I'm still concerned about exactly what it was doing,
however.  Any ideas?  Any suggestions for further debugging the situation if
it happens again?

Also, a second question while I'm here :)  Ignoring that one CPU-hogging
postmaster, does the header information in that "top" listing look
reasonable in terms of memory usage?  The "free" memory always hovers around
11412K, but "buff" and "cache" are usually huge.  I'm assuming "buff" and
"cache" memory is available if any of the processes needs it, but there is
always some small amount of swap in use anyway.  Should I be concerned, or
does this look okay?

-John




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Idle postmaster taking up a lot of CPU
  2004-01-17 15:34 Idle postmaster taking up a lot of CPU John Siracusa <siracusa@mindspring.com>
@ 2004-01-17 17:32 ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-01-17 21:33   ` Re: Idle postmaster taking up a lot of CPU John Siracusa <siracusa@mindspring.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2004-01-17 17:32 UTC (permalink / raw)
  To: siracusa@mindspring.com; +Cc: pgsql-performance

John Siracusa <siracusa@mindspring.com> writes:
> Process 20753 was hovering around 60-70% CPU usage for a long time.

> I tried to see what that postmaster was doing, but it appeared to be "idle"

> % ps -wwwx -p 20753
>   PID TTY      STAT   TIME COMMAND
> 20753 pts/3    R     26:59 postgres: postgres pdm 192.168.0.35 idle

That seems odd to me too.  What PG version is this exactly?

If it happens again, please see if you can get a stack trace from the
not-so-idle process:

	$ gdb /path/to/postgres-executable
	gdb> attach PID-of-process
	gdb> bt
	gdb> quit

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Idle postmaster taking up a lot of CPU
  2004-01-17 15:34 Idle postmaster taking up a lot of CPU John Siracusa <siracusa@mindspring.com>
  2004-01-17 17:32 ` Re: Idle postmaster taking up a lot of CPU Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-01-17 21:33   ` John Siracusa <siracusa@mindspring.com>
  0 siblings, 0 replies; 3+ messages in thread

From: John Siracusa @ 2004-01-17 21:33 UTC (permalink / raw)
  To: pgsql-performance

On 1/17/04 12:32 PM, Tom Lane wrote:
> John Siracusa <siracusa@mindspring.com> writes:
>> Process 20753 was hovering around 60-70% CPU usage for a long time.
> 
>> I tried to see what that postmaster was doing, but it appeared to be "idle"
> 
>> % ps -wwwx -p 20753
>>   PID TTY      STAT   TIME COMMAND
>> 20753 pts/3    R     26:59 postgres: postgres pdm 192.168.0.35 idle
> 
> That seems odd to me too.  What PG version is this exactly?

This is Postgres 7.4.0 on:

% uname -a
Linux foo.com 2.4.22 #5 SMP Fri Oct 10 16:32:42 EDT 2003 i686 i686 i386
GNU/Linux

> If it happens again, please see if you can get a stack trace from the
> not-so-idle process:
> 
> $ gdb /path/to/postgres-executable
> gdb> attach PID-of-process
> gdb> bt
> gdb> quit

Will do.

-John




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-01-17 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-17 15:34 Idle postmaster taking up a lot of CPU John Siracusa <siracusa@mindspring.com>
2004-01-17 17:32 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-01-17 21:33   ` John Siracusa <siracusa@mindspring.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox