Search Postgresql Archives

Re: clearing the buffer cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 13, 2009 at 11:13:36AM -0700, Scott Ribe wrote:
> > I was hoping to run many thousands of small (i.e. 100ms or less) queries
> > and if it takes a couple of seconds to restart the database I'm not
> > going to be able to do this.
> 
> Are you forgetting the OS's file system cache? That will also have a huge
> effect on performance, and so you'll need to clear it as well.

With recent versions of Linux you can flush the system's buffer cache by
doing:

  # echo 3 > /proc/sys/vm/drop_caches

This is pretty quick; I do this, wait a small amount of time just in
case and then start a new psql session.  I'm currently having to put a
restart of postgres before this flush as well which is slowing things
down a lot.

I'm not showing any statistically significant difference between the
first run and subsequent runs which would suggest that I'm either all
OK, or all wrong!

-- 
  Sam  http://samason.me.uk/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux