Re: clearing the buffer cache

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: clearing the buffer cache
Дата
Msg-id 20090213181916.GJ32672@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на Re: clearing the buffer cache  (Scott Ribe <scott_ribe@killerbytes.com>)
Ответы Re: clearing the buffer cache  (Chris Mayfield <cmayfiel@cs.purdue.edu>)
Список pgsql-general
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/

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: clearing the buffer cache
Следующее
От: "Bob Pawley"
Дата:
Сообщение: Re: Remote Connection