Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 8F69E1337C18 for ; Mon, 2 May 2011 12:18:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 92871-02-2 for ; Mon, 2 May 2011 15:18:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mail.postgresql.org (Postfix) with ESMTP id 23E9F1337C71 for ; Mon, 2 May 2011 12:17:19 -0300 (ADT) Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M53tq-1Pqs642C7C-00zNvU; Mon, 02 May 2011 17:17:19 +0200 Message-ID: <4DBECB5C.20104@2ndQuadrant.com> Date: Mon, 02 May 2011 11:18:52 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: The right SHMMAX and FILE_MAX References: <4DBE38BB.7040106@orkash.com> In-Reply-To: <4DBE38BB.7040106@orkash.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:dFhBNa6RQ5/K4dwDJ8LyX/MSAXf/qsuW2E918XWIOVM i4FPHoS7S1lKEc8XOsu+gQEcHPYrTDamrbJX2/YidFhnmHDHNm gFVMQq5vds0/PBEUCfDlMfHqB53V8pi/T6TXF/nBTbD+NDOpiL NVGGLxRfhSyQu4oIkeg65Hkayb9pkpm56h9qy+51L5Kro5K4qH ljO/3Q19UoqWobGy/5zdXTJIuVKRpYeQDRHmnrbvak= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201105/17 X-Sequence-Number: 43526 On 05/02/2011 12:53 AM, Adarsh Sharma wrote: > I am also in need of a proper documentation that explains how to set > SHMAX and SHMALL variables in Postgres. > > What things need to be taken in consideration before doing that ? > What is the value of SHMAX & SHMALL if u have 16 GB RAM for Postgres > Server ? Running the script I provided on a Linux server with 16GB of RAM: $ cat /proc/meminfo | grep MemTotal MemTotal: 16467464 kB $ getconf PAGE_SIZE 4096 $ ./shmsetup # Maximum shared segment size in bytes kernel.shmmax = 8431341568 # Maximum number of shared memory segments in pages kernel.shmall = 2058433 That sets SHMMAX to 50% of total RAM, which should be sufficient for any reasonable installation of PostgreSQL. shmmall is a similar limit expressed in system pages instead, so as seen here you have to divide by the system page size of 4096 to figure it out. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books