Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BDE35B5DC17 for ; Mon, 10 Oct 2011 13:08:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 49360-01 for ; Mon, 10 Oct 2011 16:07:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mail.postgresql.org (Postfix) with ESMTP id 0D91DB5DC29 for ; Mon, 10 Oct 2011 13:07:37 -0300 (ADT) Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MBjiJ-1RMPbc3R7X-00AWVf; Mon, 10 Oct 2011 18:07:36 +0200 Message-ID: <4E931846.80509@2ndQuadrant.com> Date: Mon, 10 Oct 2011 12:07:34 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20111004 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Adding more memory = hugh cpu load References: <4E92F294.9010405@gmail.com> <4E92FB87.1030703@peak6.com> In-Reply-To: <4E92FB87.1030703@peak6.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:2e7nymPD3nyt7XrHAj1PokmI5QtsIFFeqyteotar6NU 26iJgZmOr/ORCnIm2/npOnagXHfi+j/3uHBgCIQpAZLt74DYO0 gtCISAAtmVSbbYESHkIZG+EGGe0f5jFV4T+hG0f/+IDhfNMGEG XzL9IKmYsjy9cQ3WdqMqRoefBEAzM75K02VdOpIC3EcDFU4CSp keWXNzVla7uaRLAlQCmbvn5YfN7urlwtBJKSBixHsSuEMcUS22 yrKgTIoXBDR4fjI9qQwC+ggebT8Zlg6ezaQcGmFv3mavAhEfOt n/4IqGEZ63ILmPCvBw7sOMbwrvgVC60KBkutO/QbKkRBzM8GJX I52MpJVUxV41GEHA2Jw8= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, TO_NO_BRKTS_PCNT=0.001 X-Spam-Level: X-Archive-Number: 201110/82 X-Sequence-Number: 45304 On 10/10/2011 10:04 AM, Shaun Thomas wrote: > The problem with having lots of memory is... that you have lots of > memory. The operating system likes to cache, and this includes writes. > Normally this isn't a problem, but with 48GB of RAM, the defaults (for > CentOS 5.5 in particular) are to use up to 40% of that to cache writes. I make the same sort of tuning changes Shaun suggested on every CentOS 5 system I come across. That said, you should turn on log_checkpoints in your postgresql.conf and see whether the "sync=" numbers are high. That will help prove or disprove that the slowdown you're seeing is from too much write caching. You also may be able to improve that by adjusting checkpoint_segments/checkpoint_timeout, or *decreasing* shared_buffers. More about this at http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm There are some other possibilities, too, like that memory addition can actually causing average memory speed to drop as Kevin mentioned. I always benchmark with stream-scaling: https://github.com/gregs1104/stream-scaling before and after a RAM size change, to see whether things are still as fast or not. It's hard to do that in the position you're in now though. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us