pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Vivek Khera <vivek@khera.org>
Cc: Matthew Sullivan <matthew@sorbs.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: performance problems.
Date: Wed, 30 Aug 2006 11:26:57 -0500
Message-ID: <20060830162657.GD81373@pervasive.com> (raw)
In-Reply-To: <BA0105C5-8551-49A6-B131-00D814DDFDA0@khera.org>
References: <44F55A7F.40305@sorbs.net>
	<BA0105C5-8551-49A6-B131-00D814DDFDA0@khera.org>

On Wed, Aug 30, 2006 at 10:10:28AM -0400, Vivek Khera wrote:
> effective_cache_size = 27462            # `sysctl -n  
> vfs.hibufspace` / 8192 (BLKSZ)
> random_page_cost = 2

You misunderstand how effective_cache_size is used. It's the *only*
memory factor that plays a role in cost estimator functions. This means
it should include the memory set aside for caching in shared_buffers.

Also, hibufspace is only talking about filesystem buffers in FreeBSD,
which AFAIK has nothing to do with total memory available for caching,
since VM pages are also used to cache data.

Basically, your best bet for setting effective_cache_size is to use the
total memory in the machine, and substract some overhead for the OS and
other processes. I'll typically subtract 1G.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (13+ messages)  latest in thread

Message-ID: <20060830162657.GD81373@pervasive.com>
Permalink:  ../20060830162657.GD81373@pervasive.com/
Also on:    postgresql.org/message-id/20060830162657.GD81373@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, vivek@khera.org, matthew@sorbs.net
  Subject: Re: performance problems.
  In-Reply-To: <20060830162657.GD81373@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox