Re: turn off caching for performance test

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Willy-Bas Loos <willybas(at)gmail(dot)com>
Cc: Pierre C <lists(at)peufeu(dot)com>, acmmailing(at)tweakers(dot)net, pgsql-performance(at)postgresql(dot)org
Subject: Re: turn off caching for performance test
Date: 2010-08-27 17:28:30
Message-ID: 4C77F5BE.7070202@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Willy-Bas Loos wrote:
> But that's only the OS cache. There's also the shared_buffers, which
> are a postgres specific thing.
> I've found DISCARD in the manual
> <http://www.postgresql.org/docs/8.3/interactive/sql-discard.html>, but
> that only influences a single session, not the shared buffers.
>
> I reckon restarting the cluster should help, would it wipe out the
> cache? (pg_ctlcluster 8.3 main restart)
> Or is there a more graceful way?

Stop the cluster; flush the OS cache; start the cluster again. Now you
have a clean cache to retest again. No easier way that's reliable. If
you try to clear out the database by doing things like scanning large
tables not involved in the query, you'll discover features in PostgreSQL
will specifically defeat that from using more than a small portion of
the cache. Better to just do a full shutdown.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2010-08-27 17:30:50 Re: Slow Query
Previous Message Greg Smith 2010-08-27 17:25:08 Re: Performance on new 64bit server compared to my 32bit desktop