Re: The right SHMMAX and FILE_MAX

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: The right SHMMAX and FILE_MAX
Дата
Msg-id 4DBE8C6B.9070208@fuzzy.cz
обсуждение исходный текст
Ответ на Re: The right SHMMAX and FILE_MAX  (Adarsh Sharma <adarsh.sharma@orkash.com>)
Ответы Re: The right SHMMAX and FILE_MAX  (Adarsh Sharma <adarsh.sharma@orkash.com>)
Список pgsql-performance
Dne 2.5.2011 06:53, Adarsh Sharma napsal(a):
> I am also in need of a proper documentation that explains how to set
> SHMAX and SHMALL variables in Postgres.
>
> What things need to be taken in consideration before doing that ?
> What is the value of SHMAX & SHMALL if u have 16 GB RAM for Postgres
> Server ?

Well, those two values actually define kernel limits for shared memory
segments (i.e. memory shared by multiple processes, in this case the
postmaster proces and backends). So it's rather a question of tuning
shared_buffers (because that's the shared memory segment) and then
setting those two values.

SHMMAX - max. size of a single shared segment (in bytes)
SHMALL - total size of shared segments (in pages, page is usually 4kB)

So if you decide you want 1GB shared buffers, you'll need at least this

SHMMAX = 1024 * 1024 * 1024 (i.e. 1GB)
SHMALL = 1024 * 256 (1GB in 4kB pages)

(althouth the SHMALL should be higher, as there will be other processes
that need shared memory).

There's a lot of docs about this, e.g. this one (it's mostly for Oracle,
but it describes the shared memory quite nicely):

http://www.puschitz.com/TuningLinuxForOracle.shtml#SettingSharedMemory

regards
Tomas

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

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: The right SHMMAX and FILE_MAX
Следующее
От: Adarsh Sharma
Дата:
Сообщение: Re: The right SHMMAX and FILE_MAX