mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Make the number of CLOG buffers adaptive, based on shared_buffers.
Previously, this was hardcoded: we always had 8. Performance testing shows that isn't enough, especially on big SMP systems, so we allow it to scale up as high as 32 when there's adequate memory. On the flip side, when shared_buffers is very small, drop the number of CLOG buffers down to as little as 4, so that we can start the postmaster even when very little shared memory is available. Per extensive discussion with Simon Riggs, Tom Lane, and others on pgsql-hackers.
This commit is contained in:
@@ -171,7 +171,7 @@ NumLWLocks(void)
|
||||
numLocks += MaxBackends + NUM_AUXILIARY_PROCS;
|
||||
|
||||
/* clog.c needs one per CLOG buffer */
|
||||
numLocks += NUM_CLOG_BUFFERS;
|
||||
numLocks += CLOGShmemBuffers();
|
||||
|
||||
/* subtrans.c needs one per SubTrans buffer */
|
||||
numLocks += NUM_SUBTRANS_BUFFERS;
|
||||
|
||||
Reference in New Issue
Block a user