Re: go for a script! / ex: PostgreSQL vs. MySQL

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Vivek Khera <khera(at)kcilink(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: go for a script! / ex: PostgreSQL vs. MySQL
Date: 2003-10-11 09:23:08
Message-ID: 20031011092308.GA39942@perrin.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

> >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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-10-11 09:30:04 Re: "slicing" records
Previous Message Joshua Moore-Oliva 2003-10-11 09:10:53 PQnotifies and freeing memory.

Browse pgsql-performance by date

  From Date Subject
Next Message Chris Faulkner 2003-10-11 09:43:04 sql performance and cache
Previous Message Christopher Kings-Lynne 2003-10-11 05:20:43 Re: go for a script! / ex: PostgreSQL vs. MySQL