Re: Decrease MAX_BACKENDS to 2^16

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Decrease MAX_BACKENDS to 2^16
Дата
Msg-id 20140426131952.GE13906@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Decrease MAX_BACKENDS to 2^16  (David Fetter <david@fetter.org>)
Ответы Re: Decrease MAX_BACKENDS to 2^16  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2014-04-26 05:40:21 -0700, David Fetter wrote:
> On Sat, Apr 26, 2014 at 12:15:40AM +0200, Andres Freund wrote:
> > Hi,
> > 
> > Currently the maximum for max_connections (+ bgworkers + autovacuum) is
> > defined by
> > #define MAX_BACKENDS    0x7fffff
> > which unfortunately means that some things like buffer reference counts
> > need a full integer to store references.
> 
> Out of curiosity, where are you finding that a 32-bit integer is
> causing problems that a 16-bit one would solve?

Save space? For one it allows to shrink some structs (into one
cacheline!). For another it allows to combine flags and refcount in
buffer descriptors into one variable, manipulated atomically.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Decrease MAX_BACKENDS to 2^16
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Hashable custom types