pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndquadrant.com>
To: Willy-Bas Loos <willybas@gmail.com>
Cc: Pierre C <lists@peufeu.com>
Cc: acmmailing@tweakers.net
Cc: pgsql-performance@postgresql.org
Subject: Re: turn off caching for performance test
Date: Fri, 27 Aug 2010 13:28:30 -0400
Message-ID: <4C77F5BE.7070202@2ndquadrant.com> (raw)
In-Reply-To: <AANLkTimT19FjqVB+_kjevwbW9wG7FuV6O+nSrK0p6hYc@mail.gmail.com>
References: <AANLkTi=dBXkp2qMHZOR_gd9eD+cjwMqOwg-N6POGq+ji@mail.gmail.com>
	<op.vh128jb5eorkce@apollo13>
	<AANLkTimT19FjqVB+_kjevwbW9wG7FuV6O+nSrK0p6hYc@mail.gmail.com>

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@2ndQuadrant.com   www.2ndQuadrant.us

view thread (10+ messages)  latest in thread

Message-ID: <4C77F5BE.7070202@2ndquadrant.com>
Permalink:  ../4C77F5BE.7070202@2ndquadrant.com/
Also on:    postgresql.org/message-id/4C77F5BE.7070202@2ndquadrant.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: greg@2ndquadrant.com, willybas@gmail.com, lists@peufeu.com, acmmailing@tweakers.net
  Subject: Re: turn off caching for performance test
  In-Reply-To: <4C77F5BE.7070202@2ndquadrant.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