Re: SHMMAX and shared_bufffers
От | Thom Brown |
---|---|
Тема | Re: SHMMAX and shared_bufffers |
Дата | |
Msg-id | bddc86150811120258p572cdeadw3c2adddd4beca54d@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: SHMMAX and shared_bufffers (Greg Smith <gsmith@gregsmith.com>) |
Список | pgsql-general |
Thanks guys. I think I've got a clearer idea of what's going on here. Basically I need to take more into account than just the shared buffers setting, and knowing that, I can leave extra head-room for other options which will likely take up shared memory. Cheers Thom On Wed, Nov 12, 2008 at 1:18 AM, Greg Smith <gsmith@gregsmith.com> wrote: > On Tue, 11 Nov 2008, Thom Brown wrote: > >> I've noticed that if I set my SHMMAX to 256 * 1024 * 1024 (268435456) >> and my shared_buffers value in postgresql.conf to 256MB the server >> fails to start. I managed to find a tipping point: 249MB seems to be >> too much and 248MB seems to be okay. > > Buffers are allocated in 8K blocks. When you use '256MB', that turns into > 32768 of those. Each buffer has a header and some other overhead such that > they actually take up 8400 bytes[1], which totals 1.025X the amount that > actually goes into the buffer pool. There's another MB or two that goes > into other overhead, that part depends on things like max_connections. That > overhead computation isn't even exact in the source code![2] > > At shared_buffers=248MB, just the buffer pool overhead pushes the required > amount to allocate up to 254.3MB; that just slips by with the rest of your > settings. At 249MB, the buffer pool needs 255.3MB. With the other overhead > added in, that just exceeds the 256MB SHMMAX and fails. > > 1: > http://www.postgresql.org/docs/current/static/kernel-resources.html#SHARED-MEMORY-PARAMETERS > 2: > http://doxygen.postgresql.org/ipci_8c.html#5371eff96f6dea948021ddfc9f0f5a38 > > -- > * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD >
В списке pgsql-general по дате отправления: