aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2020-11-20 10:44:09 +1300
committerThomas Munro <tmunro@postgresql.org>2020-11-20 10:51:30 +1300
commit2ded1f1fbb6e8e2b7927cce93238775604069bc3 (patch)
treec62c3e44472eddc9a2c70c5688dd4bfeb3125c8c /src/backend/storage
parent87ab464219259abdc06b0492f0d42bc6734ae490 (diff)
downloadpostgresql-2ded1f1fbb6e8e2b7927cce93238775604069bc3.tar.gz
postgresql-2ded1f1fbb6e8e2b7927cce93238775604069bc3.zip
Adjust DSM and DSA slot usage constants (back-patch).
1. Previously, a DSA area would create up to four segments at each size before doubling the size. After this commit, it will create only two at each size, so it ramps up faster and therefore needs fewer slots. 2. Previously, the total limit on DSM slots allowed for 2 per connection. Switch to 5 per connection. This back-patches commit d061ea21 from release 13 into 10-12 based on a field complaint. Discussion: https://postgr.es/m/CAO03teA%2BjE1qt5iWDWzHqaufqBsF6EoOgZphnazps_tr_jDPZA%40mail.gmail.com Discussion: https://postgr.es/m/CA%2BhUKGL6H2BpGbiF7Lj6QiTjTGyTLW_vLR%3DSn2tEBeTcYXiMKw%40mail.gmail.com
Diffstat (limited to 'src/backend/storage')
-rw-r--r--src/backend/storage/ipc/dsm.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c
index 9bf16de9407..40a1e46fc00 100644
--- a/src/backend/storage/ipc/dsm.c
+++ b/src/backend/storage/ipc/dsm.c
@@ -45,13 +45,8 @@
#define PG_DYNSHMEM_CONTROL_MAGIC 0x9a503d32
-/*
- * There's no point in getting too cheap here, because the minimum allocation
- * is one OS page, which is probably at least 4KB and could easily be as high
- * as 64KB. Each currently sizeof(dsm_control_item), currently 8 bytes.
- */
#define PG_DYNSHMEM_FIXED_SLOTS 64
-#define PG_DYNSHMEM_SLOTS_PER_BACKEND 2
+#define PG_DYNSHMEM_SLOTS_PER_BACKEND 5
#define INVALID_CONTROL_SLOT ((uint32) -1)