Decrease MAX_BACKENDS to 2^16 - Mailing list pgsql-hackers

From Andres Freund
Subject Decrease MAX_BACKENDS to 2^16
Date
Msg-id 20140425221540.GG12174@awork2.anarazel.de
Whole thread Raw
Responses Re: Decrease MAX_BACKENDS to 2^16  (Greg Stark <stark@mit.edu>)
Re: Decrease MAX_BACKENDS to 2^16  (David Fetter <david@fetter.org>)
List pgsql-hackers
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.

Since there's absolutely no sensible scenario for setting
max_connections that high, I'd like to change the limit to 2^16, so we
can use a uint16 in BufferDesc->refcount.

Does anyone disagree? This clearly is 9.5 material, but I wanted to
raise it early, since I plan to develop some stuff for 9.5 that'd depend
on lowering it.

Greetings,

Andres Freund

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: slow startup due to LWLockAssign() spinlock
Next
From: Paul Ramsey
Date:
Subject: Hashable custom types