Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 43A83634B42 for ; Wed, 7 Apr 2010 18:54:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 34721-03 for ; Wed, 7 Apr 2010 21:54:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mail.postgresql.org (Postfix) with ESMTP id 1DC4E634DD3 for ; Wed, 7 Apr 2010 18:54:18 -0300 (ADT) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MCfv0-1NrLTY1EOY-008nsb; Wed, 07 Apr 2010 23:54:15 +0200 Message-ID: <4BBCFF04.2000508@2ndquadrant.com> Date: Wed, 07 Apr 2010 17:54:12 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Craig James CC: pgsql-performance@postgresql.org Subject: Re: Occasional giant spikes in CPU load References: <4BBCFB12.1010306@emolecules.com> In-Reply-To: <4BBCFB12.1010306@emolecules.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1+hUTD/8P12rMF7iZbHXRlV2SFkatW8zHs02u2 rsdm5gF7ASP7nRRbWH7YFZLvtlIrSPOBKpY9Ov2hJrNtbjhm+P l2tD5MZyLy45G+O3aVCsLIwqBzk2dRs X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.059 tagged_above=-10 required=5 tests=AWL=-1.060, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201004/75 X-Sequence-Number: 38325 Craig James wrote: > I managed to capture one such event using top(1) with the "batch" > option as a background process. See output below You should add "-c" to your batch top capture, then you'll be able to see what the individual postmaster processes are actually doing when things get stuck. > max_connections = 1000 > shared_buffers = 2000MB > work_mem = 256MB > Mem: 8194800k total, 8118688k used, 76112k free, 36k buffers > Swap: 2031608k total, 169348k used, 1862260k free, 7313232k cached These settings appear way too high for a server with 8GB of RAM. I'm not sure if max_connections is too large, or if it's work_mem that's too big, but one or both of them may need to be tuned way down from where they are now to get your memory usage under control. Your server might running out of RAM during the periods where it becomes unresponsive--that could be the system paging stuff out to swap, which isn't necessarily a high user of I/O but it will block things. Not having any memory used for buffers is never a good sign. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us