Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 79DCA632C4C for ; Thu, 5 Feb 2009 11:36:47 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 63067-09 for ; Thu, 5 Feb 2009 11:36:39 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qy0-f17.google.com (mail-qy0-f17.google.com [209.85.221.17]) by mail.postgresql.org (Postfix) with ESMTP id 2C651632D5E for ; Thu, 5 Feb 2009 11:36:37 -0400 (AST) Received: by qyk10 with SMTP id 10so522794qyk.19 for ; Thu, 05 Feb 2009 07:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=4GtYQdaMwjGVOcIgHwSI9kRtC8VX//URk2n/eluAaVc=; b=Be/kvlssKtE9zrxNgmgz7SXRuqBmzseG5T5pexm+JwZwQu9nskZ1Z5nx3L4GHTlqon oHwON4zs+4pQ8kvCpxZKjm7OW5eB785z8rxFW4IVHj8Ve5WK1oJEfcH7EercPWQtFcGZ QIjkimXHn4suafZG23/mhQZfw1ZKkUVNj77fk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Xt+UewIUTwMpMl/4OGZBt1wH6QkHEesgoJWZyp3jaWcjo26LdgHKLYm4w3k6fXR0k2 9NMIgnogylaH9Q1stZlfxeIwC5JN9zMHifaZ4peLY2PCmtMMoS+U/aZD8BbJuZBSeDNe h4bnQKRlFoAYtXd4G+00vgVtSu1adwDZ6l8lw= MIME-Version: 1.0 Received: by 10.215.40.16 with SMTP id s16mr903241qaj.123.1233848194444; Thu, 05 Feb 2009 07:36:34 -0800 (PST) In-Reply-To: References: Date: Thu, 5 Feb 2009 21:06:34 +0530 Message-ID: Subject: Re: question about measuring shared_buffers usage From: Rajesh Kumar Mallah To: postgres admin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/43 X-Sequence-Number: 31264 further , can pg_buffercache view serve as a guide to setting appropriate value of shared_buffers ? when i do SELECT count(*) from pg_buffercache where relfilenode is null ; to check unused buffers i find that it has been 0 most of the time. Can shared_buffers be raised to an extent that some buffers remains unused mostly. I read in one of the articles http://www.varlena.com/GeneralBits/Tidbits/perf.html#shbuf that shared_buffers can be put 1.2 to 2 times the peak shared mem usage. My question is how to roughly determine the appropriate value for shared_buffers. Also, What if most of the memory is left for kernel disk buffer cache ? is fetching from kernel disk buffer cache significantly expensive compared to getting from shared buffer cache ? regds mallah. On Thu, Feb 5, 2009 at 6:48 PM, Rajesh Kumar Mallah wrote: > Hi , > > I have following setting in my postgresql.conf file. > > shared_buffers = 10000 (8k blocks) ; which is apprx 80MB > > my question is how can i know how much is the usage > of the shared_buffers so that it can be increased or > decreased. below is the output of ipcs , I am wondering > is postgres using 420MB shared memory (but shared_buffers > is only 80MB) > > $ ipcs -m > > ------ Shared Memory Segments -------- > key shmid owner perms bytes nattch status > 0x00000000 3637248 postgres 600 52228 0 > 0x0052e6a9 7798785 postgres 600 40034304 42 > 0x00000000 4489218 postgres 600 52228 0 > 0x00000000 4521987 postgres 600 52228 0 > 0x00000000 4554756 postgres 600 52228 0 > 0x00000000 4587525 postgres 600 52228 0 > 0x00000000 4620294 postgres 600 52228 0 > 0x00000000 2883591 postgres 600 52228 0 > 0x00000000 3670024 postgres 600 74240 0 > 0x00000000 3702793 postgres 600 768 0 > 0x00000000 3735562 postgres 600 524 0 > 0x00000000 3768331 postgres 600 4 0 > 0x0052e2c1 7831564 postgres 600 420610048 121 > > regds > mallah. >