Re: how to (temporarily) disable/minimize benefits of disk block cache or postgresql shared buffer

From: Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: how to (temporarily) disable/minimize benefits of disk block cache or postgresql shared buffer
Date: 2010-07-01 17:59:20
Message-ID: AANLkTinFYSv9zxvDvKi9ChHtPkGh-KkdNbzU56tbOBY8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jul 1, 2010 at 10:07 PM, Craig Ringer
<craig(at)postnewspapers(dot)com(dot)au>wrote:

> 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.
>
> I had set it to 128kb
it does not really work , i even tried your next suggestion. I am in
virtualized
environment particularly OpenVz. where echo 3 > /proc/sys/vm/drop_caches
does not work inside the virtual container, i did it in the hardware node
but still does not give desired result.
regds
Rajesh Kumar Mallah.

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Michal Fapso 2010-07-01 22:34:53 big data - slow select (speech search)
Previous Message Craig Ringer 2010-07-01 16:37:51 Re: how to (temporarily) disable/minimize benefits of disk block cache or postgresql shared buffer