pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Rajesh Kumar Mallah <mallah.rajesh@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: how to (temporarily) disable/minimize benefits of disk block cache or 	postgresql shared buffer
Date: Fri, 02 Jul 2010 00:37:51 +0800
Message-ID: <4C2CC45F.4060505@postnewspapers.com.au> (raw)
In-Reply-To: <AANLkTin0eIqjfIF2KoUcclnH_86X6aqOh5yNygu6f4pf@mail.gmail.com>
References: <AANLkTin0eIqjfIF2KoUcclnH_86X6aqOh5yNygu6f4pf@mail.gmail.com>

On 01/07/10 17:41, Rajesh Kumar Mallah wrote:
> Hi,
> 
> this is not really a performance question , sorry if its bit irrelevant
> to be posted here. We have a development environment and we want
> to optimize the non-database parts of the application. The problem is
> that subsequent run of  queries are execute very fast and makes the
> performance analysis a trivial problem. We want that the subsequent runs
> of query should take similar times as the first run so that we can work
> on the optimizing the calling patterns to the database.

You can get rid of PostgreSQL's caches in shared_buffers by restarting
the PostgreSQL server. I don't know if there's any more convenient way.
Alternately, just set a really minimal shared_buffers that's just enough
for your connections so there's not much room for cached data.

If you are running a Linux server (as you didn't mention what you're
running on) you can drop the OS disk cache quite easily:

  http://linux-mm.org/Drop_Caches
  http://www.linuxinsight.com/proc_sys_vm_drop_caches.html

AFAIK for most other platforms you have to use a tool that gobbles
memory to force caches out. On Windows, most of those garbage tools that
claim to "free" memory do this - it's about the only time you'd ever
want to use one, since they do such horrid things to performance.

--
Craig Ringer



view thread (6+ messages)  latest in thread

Message-ID: <4C2CC45F.4060505@postnewspapers.com.au>
Permalink:  ../4C2CC45F.4060505@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4C2CC45F.4060505@postnewspapers.com.au

 · 

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: craig@postnewspapers.com.au, mallah.rajesh@gmail.com
  Subject: Re: how to (temporarily) disable/minimize benefits of disk block cache or 	postgresql shared buffer
  In-Reply-To: <4C2CC45F.4060505@postnewspapers.com.au>

* 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