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

Commit98f320e

Browse files
committed
Increase default vacuum_buffer_usage_limit to 2MB.
The BAS_VACUUM ring size has been 256kB since commitd526575 introducedthe mechanism 17 years ago. Commit1cbbee0 recently made itconfigurable but retained the traditional default. The correct defaultsize has been debated for years, but 256kB is certainly very small.VACUUM soon needs to write back data it dirtied only 32 blocks ago,which usually requires flushing the WAL. New experiments in prefetchingpages for VACUUM exacerbated the problem by crashing into dirty dataeven sooner. Let's make the default 2MB. That's 1.6% of the defaulttoy buffer pool size, and 0.2% of 1GB, which would be a considered asmall shared_buffers setting for a real system these days. Users arestill free to set the GUC to a different value.Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/20240403221257.md4gfki3z75cdyf6%40awork3.anarazel.deDiscussion:https://postgr.es/m/CA%2BhUKGLY4Q4ZY4f1rvnFtv6%2BPkjNf8MejdPkcju3Qii9DYqqcQ%40mail.gmail.com
1 parent3bd8439 commit98f320e

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ include_dir 'conf.d'
19611961
valid sizes range from <literal>128 kB</literal> to
19621962
<literal>16 GB</literal>. If the specified size would exceed 1/8 the
19631963
size of <varname>shared_buffers</varname>, the size is silently capped
1964-
to that value. The default value is <literal>256 kB</literal>. If
1964+
to that value. The default value is <literal>2MB</literal>. If
19651965
this value is specified without units, it is taken as kilobytes. This
19661966
parameter can be set at any time. It can be overridden for
19671967
<xref linkend="sql-vacuum"/> and <xref linkend="sql-analyze"/>

‎src/backend/storage/buffer/freelist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ GetAccessStrategy(BufferAccessStrategyType btype)
561561
ring_size_kb=16*1024;
562562
break;
563563
caseBAS_VACUUM:
564-
ring_size_kb=256;
564+
ring_size_kb=2048;
565565
break;
566566

567567
default:

‎src/backend/utils/init/globals.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ intmax_parallel_workers = 8;
143143
intMaxBackends=0;
144144

145145
/* GUC parameters for vacuum */
146-
intVacuumBufferUsageLimit=256;
146+
intVacuumBufferUsageLimit=2048;
147147

148148
intVacuumCostPageHit=1;
149149
intVacuumCostPageMiss=2;

‎src/backend/utils/misc/guc_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ struct config_int ConfigureNamesInt[] =
22752275
GUC_UNIT_KB
22762276
},
22772277
&VacuumBufferUsageLimit,
2278-
256,0,MAX_BAS_VAC_RING_SIZE_KB,
2278+
2048,0,MAX_BAS_VAC_RING_SIZE_KB,
22792279
check_vacuum_buffer_usage_limit,NULL,NULL
22802280
},
22812281

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
# mmap
167167
# (change requires restart)
168168
#min_dynamic_shared_memory = 0MB# (change requires restart)
169-
#vacuum_buffer_usage_limit =256kB# size of vacuum and analyze buffer access strategy ring;
169+
#vacuum_buffer_usage_limit =2MB# size of vacuum and analyze buffer access strategy ring;
170170
# 0 to disable vacuum buffer access strategy;
171171
# range 128kB to 16GB
172172

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp