Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3acc10c

Browse files
committed
Increase the number of buffer mapping partitions to 128.
Testing by Amit Kapila, Andres Freund, and myself, with and withoutother patches that also aim to improve scalability, seems to indicatethat this change is a significant win over the current value and oversmaller values such as 64. It's not clear how high we can push thisvalue before it starts to have negative side-effects elsewhere, butgoing this far looks OK.
1 parent9528726 commit3acc10c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/backend/storage/lmgr/lwlock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ static LWLockTranche MainLWLockTranche;
7373

7474
/*
7575
* We use this structure to keep track of locked LWLocks for release
76-
* during error recovery.The maximum size couldbedetermined atruntime
77-
*if necessary, but it seems unlikely that more than a few locks could
78-
*ever be held simultaneously.
76+
* during error recovery.Normally, only a few willbeheld atonce, but
77+
*occasionally the number can be much higher; for example, the pg_buffercache
78+
*extension locks all buffer partitions simultaneously.
7979
*/
80-
#defineMAX_SIMUL_LWLOCKS100
80+
#defineMAX_SIMUL_LWLOCKS200
8181

8282
staticintnum_held_lwlocks=0;
8383
staticLWLock*held_lwlocks[MAX_SIMUL_LWLOCKS];

‎src/include/storage/lwlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ extern PGDLLIMPORT LWLockPadded *MainLWLockArray;
136136
*/
137137

138138
/* Number of partitions of the shared buffer mapping hashtable */
139-
#defineNUM_BUFFER_PARTITIONS16
139+
#defineNUM_BUFFER_PARTITIONS128
140140

141141
/* Number of partitions the shared lock tables are divided into */
142142
#defineLOG2_NUM_LOCK_PARTITIONS 4

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp