X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id ED435D1B467 for ; Sat, 17 Jan 2004 15:35:27 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 44307-09 for ; Sat, 17 Jan 2004 11:35:00 -0400 (AST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by svr1.postgresql.org (Postfix) with ESMTP id A59B6D1B498 for ; Sat, 17 Jan 2004 11:34:55 -0400 (AST) Received: from [10.0.1.3] (h000393e3ce55.ne.client2.attbi.com[24.91.235.158]) by comcast.net (rwcrmhc13) with SMTP id <2004011715345901500kg77he>; Sat, 17 Jan 2004 15:34:59 +0000 User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Sat, 17 Jan 2004 10:34:22 -0500 Subject: Idle postmaster taking up a lot of CPU From: John Siracusa To: Postgres Performance Message-ID: Mime-version: 1.0 Reply-To: siracusa@mindspring.com Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/185 X-Sequence-Number: 5359 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