Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLqmo-0002xa-23 for pgsql-performance@postgresql.org; Wed, 10 Oct 2012 07:32:58 +0000 Received: from [2001:1528:137::f1] (helo=mail.gransy.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLqml-0006Xn-FY for pgsql-performance@postgresql.org; Wed, 10 Oct 2012 07:32:57 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id AF04E508A2D for ; Wed, 10 Oct 2012 09:32:54 +0200 (CEST) Received: from mail.gransy.com ([82.208.44.189]) by antispam.gransy.com (antispam.gransy.com [77.78.104.124]) (amavisd-new, port 10024) with ESMTP id U5O40AB7CZn9 for ; Wed, 10 Oct 2012 09:32:54 +0200 (CEST) Received: by mail.gransy.com (Postfix, from userid 5000) id 9D5ED508A48; Wed, 10 Oct 2012 09:32:54 +0200 (CEST) Received: from [192.168.1.237] (ip-78-45-133-255.net.upcbroadband.cz [78.45.133.255]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id 69D28508A2D for ; Wed, 10 Oct 2012 09:32:54 +0200 (CEST) Message-ID: <507524A6.8000505@fuzzy.cz> Date: Wed, 10 Oct 2012 09:32:54 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: shared_buffers/effective_cache_size on 96GB server References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:1528:137::f1 (failed) X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201210/102 X-Sequence-Number: 48061 On 10.10.2012 09:12, Strahinja Kustudi=C4=87 wrote: > Hi everyone, >=20 > I have a Postgresql 9.1 dedicated server with 16 cores, 96GB RAM and > RAID10 15K SCSI drives which is runing Centos 6.2 x64. This server is > mainly used for inserting/updating large amounts of data via > copy/insert/update commands, and seldom for running select queries. >=20 > Here are the relevant configuration parameters I changed: >=20 > shared_buffers =3D 10GB > effective_cache_size =3D 90GB > work_mem =3D 32MB > maintenance_work_mem =3D 512MB > checkpoint_segments =3D 64 > checkpoint_completion_target =3D 0.8 >=20 > My biggest concern are shared_buffers and effective_cache_size, should = I > increase shared_buffers and decrease effective_cache_size? I read that > values above 10GB for shared_buffers give lower performance, than > smaller amounts? >=20 > free is currently reporting (during the loading of data): >=20 > $ free -m > total used free shared buffers cach= ed > Mem: 96730 96418 311 0 71 931= 20 > -/+ buffers/cache: 3227 93502 > Swap: 21000 51 20949 >=20 > So it did a little swapping, but only minor, still I should probably > decrease shared_buffers so there is no swapping at all. That's hardly caused by shared buffers. The main point is that effective_cache_size is just a hint to the optimizer how much cache (shared buffers + page cache) to expect. So it's unlikely PostgreSQL is going to allocate 100GB of RAM or something. What have you set to the main /proc/sys/vm/ parameters? Mainly these thre= e: /proc/sys/vm/swappiness /proc/sys/vm/overcommit_memory /proc/sys/vm/overcommit_ratio Tomas