Re: Swappiness setting on a linux pg server

Поиск
Список
Период
Сортировка
От Kevin
Тема Re: Swappiness setting on a linux pg server
Дата
Msg-id 49298.209.244.4.106.1161290341.squirrel@www.drule.org
обсуждение исходный текст
Ответ на Swappiness setting on a linux pg server  (Tobias Brox <tobias@nordicbet.com>)
Список pgsql-performance
> I just came to think about /proc/sys/swappiness ...
>
> When this one is set to a high number (say, 100 - which is maximum), the
> kernel will aggressively swap out all memory that is not beeing
> accessed, to allow more memory for caches.  For a postgres server, OS
> caches are good, because postgres relies on the OS to cache indices,
> etc.  At the other hand, for any production server it's very bad to
> experience bursts of iowait when/if the swapped out memory becomes
> needed - particularly if the server is used for interactive queries,
> like serving a web application.

This is very useful on smaller systems where memory is a scarce commodity.
 I have a Xen virtual server with 128MB ram.  I noticed a big improvement
in query performance when I upped swappiness to 80.  It gave just enough
more memory to fs buffers so my common queries ran in memory.

Yes, throwing more ram at it is usually the better solution, but it's nice
linux gives you that knob to turn when adding ram isn't an option, at
least for me.


--
Kevin


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

Предыдущее
От: Tobias Brox
Дата:
Сообщение: Re: Swappiness setting on a linux pg server
Следующее
От: Ben Suffolk
Дата:
Сообщение: New hardware thoughts