pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oleg Bartunov <oleg@sai.msu.su>
To: Greg Smith <gsmith@gregsmith.com>
Cc: Matthew Pulis <mpulis@gmail.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PostgreSQL Cache
Date: Mon, 29 Sep 2008 11:51:52 +0400 (MSD)
Message-ID: <Pine.LNX.4.64.0809291144160.15810@sn.sai.msu.ru> (raw)
In-Reply-To: <Pine.GSO.4.64.0809290237330.18983@westnet.com>
References: <f88da7150809282143w71c0920avb51f7809eb398ef7@mail.gmail.com>
	<Pine.GSO.4.64.0809290237330.18983@westnet.com>

A while ago I wrote a script based on Dave Plonka work
http://net.doit.wisc.edu/~plonka/fincore/

My script monitors system buffers and shared buffers 
(if pg_buffercache installed) and I found it's almost useless to 
check system buffers, since I got rather ridiculous numbers.

> I use it to investigate OS cacheing of PostgreSQL files and was
> surprized on 24 Gb server, total cache was about 30 Gb. How this is
> possible ?

I can send script and perl module if you want to play with.



Oleg

On Mon, 29 Sep 2008, Greg Smith wrote:

> On Mon, 29 Sep 2008, Matthew Pulis wrote:
>
>> I need to perform some timed testing, thus need to make sure that disk 
>> cache
>> does not affect me. Is clearing the OS (Ubuntu) disk cache, ( by running:
>> sudo echo 3 | sudo tee /proc/sys/vm/drop_caches ) enough to do this?
>
> What you should do is:
>
> 1) Shutdown the database server (pg_ctl, sudo service postgresql stop, etc.)
> 2) sync
> 3) sudo echo 3 > /proc/sys/vm/drop_caches
> 4) Start the database server
>
> That will clear both the database and OS cache with a minimum of junk left 
> behind in the process; clearing the cache without a sync is a bad idea.
>
> Note that all of this will still leave behind whatever cache is in your disk 
> controller card or on the disk themselves available.  There are some other 
> techniques you could consider.  Add a setp 2.5 that generates a bunch of data 
> unused by the test, then sync again, and you've turned most of that into 
> useless caching.
>
> Ideally, your test should be running against a large enough data set that the 
> dozens or couple of hundred megabytes that might be in those will only add a 
> bit of noise to whatever you're testing.  If you're not running a larger test 
> or going through tasts to make the caches clear, the only easy way to make 
> things more clear is to reboot the whole server.
>
> --
> * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD
>
>

 	Regards,
 		Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83



view thread (7+ messages)  latest in thread

Message-ID: <Pine.LNX.4.64.0809291144160.15810@sn.sai.msu.ru>
Permalink:  ../Pine.LNX.4.64.0809291144160.15810@sn.sai.msu.ru/
Also on:    postgresql.org/message-id/Pine.LNX.4.64.0809291144160.15810@sn.sai.msu.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: oleg@sai.msu.su, gsmith@gregsmith.com, mpulis@gmail.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] PostgreSQL Cache
  In-Reply-To: <Pine.LNX.4.64.0809291144160.15810@sn.sai.msu.ru>
  References: <f88da7150809282143w71c0920avb51f7809eb398ef7@mail.gmail.com> <Pine.GSO.4.64.0809290237330.18983@westnet.com> <Pine.LNX.4.64.0809291144160.15810@sn.sai.msu.ru>

* 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