pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sean Chittenden <sean@chittenden.org>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: Vivek Khera <khera@kcilink.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: go for a script! / ex:  PostgreSQL vs. MySQL
Date: Sat, 11 Oct 2003 02:23:08 -0700
Message-ID: <20031011092308.GA39942@perrin.nxad.com> (raw)
In-Reply-To: <3F87932B.4050507@familyhealth.com.au>
References: <007901c38f2b$0b585590$2802a8c0@webbased10>
	<200310101034.52073.josh@agliodbs.com>
	<3F86F5BB.90605@chuckie.co.uk>
	<x7wubcon3h.fsf@yertle.int.kciLink.com>
	<3F87932B.4050507@familyhealth.com.au>

> >NB> shared_buffers = 1/16th of total memory
> >NB> effective_cache_size = 80% of the supposed kernel cache.
> 
> I think Sean(?) mentioned this one for FreeBSD (Bash code):

sh, not bash.  :)

> echo "effective_cache_size = $((`sysctl -n vfs.hibufspace` / 8192))"
> 
> I've used it for my dedicated servers.  Is this calculation correct?

Yes, or it's real close at least.  vfs.hibufspace is the amount of
kernel space that's used for caching IO operations (minus the
necessary space taken for the kernel).  If you're real paranoid, you
could do some kernel profiling and figure out how much of the cache is
actually disk IO and multiply the above by some percentage, say 80%?
I haven't found it necessary to do so yet.  Since hibufspace is all IO
and caching any net activity is kinda pointless and I assume that 100%
of it is used for a disk cache and don't use a multiplier.  The 8192,
however, is the size of a PG page, so, if you tweak PG's page size,
you have to change this constant (*grumbles*).

-sc

-- 
Sean Chittenden



view thread (42+ messages)  latest in thread

Message-ID: <20031011092308.GA39942@perrin.nxad.com>
Permalink:  ../20031011092308.GA39942@perrin.nxad.com/
Also on:    postgresql.org/message-id/20031011092308.GA39942@perrin.nxad.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: sean@chittenden.org, chriskl@familyhealth.com.au, khera@kcilink.com
  Subject: Re: go for a script! / ex:  PostgreSQL vs. MySQL
  In-Reply-To: <20031011092308.GA39942@perrin.nxad.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