aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/activity/wait_event_names.txt15
-rw-r--r--src/backend/utils/init/globals.c9
-rw-r--r--src/backend/utils/misc/guc_tables.c78
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample9
4 files changed, 104 insertions, 7 deletions
diff --git a/src/backend/utils/activity/wait_event_names.txt b/src/backend/utils/activity/wait_event_names.txt
index 4fffb466255..ec2f31f82af 100644
--- a/src/backend/utils/activity/wait_event_names.txt
+++ b/src/backend/utils/activity/wait_event_names.txt
@@ -295,11 +295,7 @@ SInvalWrite "Waiting to add a message to the shared catalog invalidation queue."
WALBufMapping "Waiting to replace a page in WAL buffers."
WALWrite "Waiting for WAL buffers to be written to disk."
ControlFile "Waiting to read or update the <filename>pg_control</filename> file or create a new WAL file."
-XactSLRU "Waiting to access the transaction status SLRU cache."
-SubtransSLRU "Waiting to access the sub-transaction SLRU cache."
MultiXactGen "Waiting to read or update shared multixact state."
-MultiXactOffsetSLRU "Waiting to access the multixact offset SLRU cache."
-MultiXactMemberSLRU "Waiting to access the multixact member SLRU cache."
RelCacheInit "Waiting to read or update a <filename>pg_internal.init</filename> relation cache initialization file."
CheckpointerComm "Waiting to manage fsync requests."
TwoPhaseState "Waiting to read or update the state of prepared transactions."
@@ -310,19 +306,16 @@ Autovacuum "Waiting to read or update the current state of autovacuum workers."
AutovacuumSchedule "Waiting to ensure that a table selected for autovacuum still needs vacuuming."
SyncScan "Waiting to select the starting location of a synchronized table scan."
RelationMapping "Waiting to read or update a <filename>pg_filenode.map</filename> file (used to track the filenode assignments of certain system catalogs)."
-NotifySLRU "Waiting to access the <command>NOTIFY</command> message SLRU cache."
NotifyQueue "Waiting to read or update <command>NOTIFY</command> messages."
SerializableXactHash "Waiting to read or update information about serializable transactions."
SerializableFinishedList "Waiting to access the list of finished serializable transactions."
SerializablePredicateList "Waiting to access the list of predicate locks held by serializable transactions."
-SerialSLRU "Waiting to access the serializable transaction conflict SLRU cache."
SyncRep "Waiting to read or update information about the state of synchronous replication."
BackgroundWorker "Waiting to read or update background worker state."
DynamicSharedMemoryControl "Waiting to read or update dynamic shared memory allocation information."
AutoFile "Waiting to update the <filename>postgresql.auto.conf</filename> file."
ReplicationSlotAllocation "Waiting to allocate or free a replication slot."
ReplicationSlotControl "Waiting to read or update replication slot state."
-CommitTsSLRU "Waiting to access the commit timestamp SLRU cache."
CommitTs "Waiting to read or update the last value set for a transaction commit timestamp."
ReplicationOrigin "Waiting to create, drop or use a replication origin."
MultiXactTruncation "Waiting to read or truncate multixact information."
@@ -375,6 +368,14 @@ LogicalRepLauncherDSA "Waiting to access logical replication launcher's dynamic
LogicalRepLauncherHash "Waiting to access logical replication launcher's shared hash table."
DSMRegistryDSA "Waiting to access dynamic shared memory registry's dynamic shared memory allocator."
DSMRegistryHash "Waiting to access dynamic shared memory registry's shared hash table."
+CommitTsSLRU "Waiting to access the commit timestamp SLRU cache."
+MultiXactOffsetSLRU "Waiting to access the multixact offset SLRU cache."
+MultiXactMemberSLRU "Waiting to access the multixact member SLRU cache."
+NotifySLRU "Waiting to access the <command>NOTIFY</command> message SLRU cache."
+SerialSLRU "Waiting to access the serializable transaction conflict SLRU cache."
+SubtransSLRU "Waiting to access the sub-transaction SLRU cache."
+XactSLRU "Waiting to access the transaction status SLRU cache."
+
#
# Wait Events - Lock
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index f024b1a8497..5eaee88d969 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -157,3 +157,12 @@ int64 VacuumPageDirty = 0;
int VacuumCostBalance = 0; /* working state for vacuum */
bool VacuumCostActive = false;
+
+/* configurable SLRU buffer sizes */
+int commit_timestamp_buffers = 0;
+int multixact_member_buffers = 32;
+int multixact_offset_buffers = 16;
+int notify_buffers = 16;
+int serializable_buffers = 32;
+int subtransaction_buffers = 0;
+int transaction_buffers = 0;
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index f5dcb5503a6..93ded31ed92 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -28,6 +28,7 @@
#include "access/commit_ts.h"
#include "access/gin.h"
+#include "access/slru.h"
#include "access/toast_compression.h"
#include "access/twophase.h"
#include "access/xlog_internal.h"
@@ -2284,6 +2285,83 @@ struct config_int ConfigureNamesInt[] =
},
{
+ {"commit_timestamp_buffers", PGC_POSTMASTER, RESOURCES_MEM,
+ gettext_noop("Sets the size of the dedicated buffer pool used for the commit timestamp cache."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &commit_timestamp_buffers,
+ 0, 0, SLRU_MAX_ALLOWED_BUFFERS,
+ check_commit_ts_buffers, NULL, NULL
+ },
+
+ {
+ {"multixact_member_buffers", PGC_POSTMASTER, RESOURCES_MEM,
+ gettext_noop("Sets the size of the dedicated buffer pool used for the MultiXact member cache."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &multixact_member_buffers,
+ 32, 16, SLRU_MAX_ALLOWED_BUFFERS,
+ check_multixact_member_buffers, NULL, NULL
+ },
+
+ {
+ {"multixact_offset_buffers", PGC_POSTMASTER, RESOURCES_MEM,
+ gettext_noop("Sets the size of the dedicated buffer pool used for the MultiXact offset cache."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &multixact_offset_buffers,
+ 16, 16, SLRU_MAX_ALLOWED_BUFFERS,
+ check_multixact_offset_buffers, NULL, NULL
+ },
+
+ {
+ {"notify_buffers", PGC_POSTMASTER, RESOURCES_MEM,
+ gettext_noop("Sets the size of the dedicated buffer pool used for the LISTEN/NOTIFY message cache."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &notify_buffers,
+ 16, 16, SLRU_MAX_ALLOWED_BUFFERS,
+ check_notify_buffers, NULL, NULL
+ },
+
+ {
+ {"serializable_buffers", PGC_POSTMASTER, RESOURCES_MEM,
+ gettext_noop("Sets the size of the dedicated buffer pool used for the serializable transaction cache."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &serializable_buffers,
+ 32, 16, SLRU_MAX_ALLOWED_BUFFERS,
+ check_serial_buffers, NULL, NULL
+ },
+
+ {
+ {"subtransaction_buffers", PGC_POSTMASTER, RESOURCES_MEM,
+ gettext_noop("Sets the size of the dedicated buffer pool used for the sub-transaction cache."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &subtransaction_buffers,
+ 0, 0, SLRU_MAX_ALLOWED_BUFFERS,
+ check_subtrans_buffers, NULL, NULL
+ },
+
+ {
+ {"transaction_buffers", PGC_POSTMASTER, RESOURCES_MEM,
+ gettext_noop("Sets the size of the dedicated buffer pool used for the transaction status cache."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &transaction_buffers,
+ 0, 0, SLRU_MAX_ALLOWED_BUFFERS,
+ check_transaction_buffers, NULL, NULL
+ },
+
+ {
{"temp_buffers", PGC_USERSET, RESOURCES_MEM,
gettext_noop("Sets the maximum number of temporary buffers used by each session."),
NULL,
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index c97f9a25f05..edcc0282b2d 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -50,6 +50,15 @@
#external_pid_file = '' # write an extra PID file
# (change requires restart)
+# - SLRU Buffers (change requires restart) -
+
+#commit_timestamp_buffers = 0 # memory for pg_commit_ts (0 = auto)
+#multixact_offset_buffers = 16 # memory for pg_multixact/offsets
+#multixact_member_buffers = 32 # memory for pg_multixact/members
+#notify_buffers = 16 # memory for pg_notify
+#serializable_buffers = 32 # memory for pg_serial
+#subtransaction_buffers = 0 # memory for pg_subtrans (0 = auto)
+#transaction_buffers = 0 # memory for pg_xact (0 = auto)
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION