Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C00466333E5 for ; Wed, 3 Feb 2010 14:41:50 -0400 (AST) 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 76472-09 for ; Wed, 3 Feb 2010 18:41:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from marajade.localdomain (vcs5.camavision.com [63.228.164.252]) by mail.postgresql.org (Postfix) with ESMTP id 14E6B63358D for ; Wed, 3 Feb 2010 14:41:40 -0400 (AST) Received: from [192.168.10.85] (unknown [192.168.10.85]) (Authenticated sender: andy) by marajade.localdomain (Postfix) with ESMTPA id BCE1940705; Wed, 3 Feb 2010 12:41:38 -0600 (CST) Message-ID: <4B69C363.10506@squeakycode.net> Date: Wed, 03 Feb 2010 12:41:39 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Amitabh Kant , pgsql-performance@postgresql.org Subject: Re: Optimizing Postgresql server and FreeBSD for heavy read and writes References: <84b68b3d1002030710x76c31adft58c56624409011fd@mail.gmail.com> In-Reply-To: <84b68b3d1002030710x76c31adft58c56624409011fd@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.584 tagged_above=-10 required=5 tests=AWL=-0.585, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201002/64 X-Sequence-Number: 37485 On 2/3/2010 9:10 AM, Amitabh Kant wrote: > Hello > > I have a server dedicated for Postgres with the following specs: > > RAM 16GB, 146GB SAS (15K) x 4 - RAID 10 with BBU, Dual Xeon E5345 @ > 2.33GHz > OS: FreeBSD 8.0 > > It runs multiple (approx 10) databases ranging from 500MB to over 24 GB > in size. All of them are of the same structure, and almost all of them > have very heavy read and writes. > > > With regards > > Amitabh Kant What problems are you having? Is it slow? Is there something you are trying to fix, or is this just the first tune up? > memory allocations. The last time I tried, Postgres refused to start and > I had to fall back to the default settings. Its probably upset about the amount of shared mem. There is probably a way in bsd to set the max amount of shared memory available. A Quick google turned up: kern.ipc.shmmax Dunno if thats right. When you try to start PG, if it cannot allocate enough shared mem it'll spit out an error message into its log saying how much it tried to allocate. Check: http://archives.postgresql.org/pgsql-admin/2004-06/msg00155.php > maintenance_work_mem = 960MB # pg_generate_conf wizard 2010-02-03 > checkpoint_completion_target = 0.9 # pg_generate_conf wizard 2010-02-03 > effective_cache_size = 11GB # pg_generate_conf wizard 2010-02-03 > work_mem = 160MB # pg_generate_conf wizard 2010-02-03 > wal_buffers = 8MB # pg_generate_conf wizard 2010-02-03 > checkpoint_segments = 16 # pg_generate_conf wizard 2010-02-03 > shared_buffers = 3840MB # pg_generate_conf wizard 2010-02-03 > max_connections = 100 # pg_generate_conf wizard 2010-02-03 Some of these seem like too much. I'd recommend starting with one or two and see how it runs. Then increase if you're still slow. Start with effective_cache_size, shared_buffers and checkpoint_segments. Wait until very last to play with work_mem and maintenance_work_mem. -Andy