Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 392FF632B61 for ; Fri, 25 Jun 2010 14:07:01 -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 96711-02 for ; Fri, 25 Jun 2010 17:06:53 +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 F3159632605 for ; Fri, 25 Jun 2010 14:06:52 -0300 (ADT) Received: from [75.197.236.239] (239.sub-75-197-236.myvzw.com [75.197.236.239]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MW7C9-1OhnRN4A5x-00Y2D8; Fri, 25 Jun 2010 19:06:30 +0200 Message-ID: <4C24E212.2020504@2ndquadrant.com> Date: Fri, 25 Jun 2010 13:06:26 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Rajesh Kumar Mallah CC: Kevin Grittner , Yeb Havinga , pgsql-performance@postgresql.org Subject: Re: sudden spurt in swap utilization (was:cpu bound postgresql setup.) References: <4C2492F9.2020706@gmail.com> <4C2477A20200002500032B03@gw.wicourts.gov> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19ky5jB2PzYCucAfLbMgF8PXfTmXtu9kTVisFf sd7G6QJaZIGmOP1Pgn14K1UGbYDn6y0icC1UvYm1UNYRPElbqL Nd20H4Nwd/CnocavfEfq50I/Fid1di7 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.5 tagged_above=-10 required=5 tests=BAYES_05=-0.5, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/475 X-Sequence-Number: 39331 Rajesh Kumar Mallah wrote: > default_statistics_target = 50 # pgtune wizard 2010-06-25 > (current 100 via default) > (*) effective_cache_size = 22GB # pgtune wizard 2010-06-25 (18GB , > specified) > checkpoint_segments = 16 # pgtune wizard 2010-06-25 (30 , specified) You probably want to keep your existing values for all of these. Your effective_cache_size setting may be a little low, but I wouldn't worry about changing that right now--you have bigger problems right now. > (*) maintenance_work_mem = 1GB # pgtune wizard 2010-06-25 (16MB via > default) > (*) wal_buffers = 8MB # pgtune wizard 2010-06-25 ( 64kb , via default) > checkpoint_completion_target = 0.9 # pgtune wizard 2010-06-25 > (0.5 via default) > shared_buffers = 7680MB # pgtune wizard 2010-06-25 ( 4096 MB , > specified) These are all potentially better for your system, but you'll use more RAM if you make these changes. For example, if you're having swap trouble, you definitely don't want to increase maintenance_work_mem. I suspect that 8GB of shared_buffers is probably the most you want to use. Most systems stop gaining any more benefit from that somewhere between 8GB and 10GB, and instead performance gets worse; it's better to be on the low side of that drop. You can probably support 8GB just fine if you sort out the work_mem issues. > (*) max_connections = 80 # pgtune wizard 2010-06-25 ( 300 , ;-) > specified ) > work_mem = 192MB # pgtune wizard 2010-06-25 (256MB , specified) pgtune makes a guess at how many connections you'll have based on specified workload. If you know you have more connections than that, you should specify that on the command line: pgtune -c 300 ... It will then re-compute the work_mem figure more accurately using that higher connection count. Right now, it's guessing 192MB based on 80 connections, which is on the high side of reasonable. 192MB with *300* connections is way oversized. My rough computation says that if you tell it the number of connections correctly, pgtune will suggest to you around 50MB for work_mem. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us