Allow maximum number of backends to be set at configure time
Tom Lane <tgl@sss.pgh.pa.us>
Allow maximum number of backends to be set at configure time (--with-maxbackends). Add a postmaster switch (-N backends) that allows the limit to be reduced at postmaster start time. (You can't increase it, sorry to say, because there are still some fixed-size arrays.) Grab the number of semaphores indicated by min(MAXBACKENDS, -N) at postmaster startup, so that this particular form of bogus configuration is exposed immediately rather than under heavy load.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/postmaster/postmaster.c | modified | +34 −10 |
| src/backend/storage/ipc/ipci.c | modified | +7 −5 |
| src/backend/storage/ipc/sinvaladt.c | modified | +7 −7 |
| src/backend/storage/lmgr/lock.c | modified | +7 −7 |
| src/backend/storage/lmgr/proc.c | modified | +53 −14 |
| src/backend/utils/init/postinit.c | modified | +2 −2 |
| src/configure | modified | +347 −327 |
| src/configure.in | modified | +10 −1 |
| src/include/config.h.in | modified | +11 −1 |
| src/include/storage/ipc.h | modified | +2 −2 |
| src/include/storage/lmgr.h | modified | +2 −2 |
| src/include/storage/lock.h | modified | +4 −5 |
| src/include/storage/proc.h | modified | +13 −5 |
| src/include/storage/sinvaladt.h | modified | +3 −4 |