aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelanie Plageman <melanieplageman@gmail.com>2025-03-12 15:56:59 -0400
committerMelanie Plageman <melanieplageman@gmail.com>2025-03-12 15:57:44 -0400
commitff79b5b2aba02d720f9b7fff644dd50ce07b8c6e (patch)
tree4591f073288d14e04bb2e5b000ab496a55669bf4 /src
parentaf717317a04f5217728ce296edf4a581eb7e6ea0 (diff)
downloadpostgresql-ff79b5b2aba02d720f9b7fff644dd50ce07b8c6e.tar.gz
postgresql-ff79b5b2aba02d720f9b7fff644dd50ce07b8c6e.zip
Increase default effective_io_concurrency to 16
The default effective_io_concurrency has been 1 since it was introduced in b7b8f0b6096d2ab6e. Referencing the associated discussion [1], it seems 1 was chosen as a conservative value that seemed unlikely to cause regressions. Experimentation on high latency cloud storage as well as fast, local nvme storage (see Discussion link) shows that even slightly higher values improve query timings substantially. 1 actually performs worse than 0 [2]. With effective_io_concurrency 1, we are not prefetching enough to avoid I/O stalls, but we are issuing extra syscalls. The new default is 16, which should be more appropriate for common hardware while still avoiding flooding low IOPs devices with I/O requests. [1] https://www.postgresql.org/message-id/flat/FDDBA24E-FF4D-4654-BA75-692B3BA71B97%40enterprisedb.com [2] https://www.postgresql.org/message-id/CAAKRu_Zv08Cic%3DqdCfzrQabpEXGrd9Z9UOW5svEVkCM6%3DFXA9g%40mail.gmail.com Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAAKRu_Z%2BJa-mwXebOoOERMMUMvJeRhzTjad4dSThxG0JLXESxw%40mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample2
-rw-r--r--src/include/storage/bufmgr.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index d2bd329a587..36cb64d7ebc 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -198,7 +198,7 @@
# - I/O -
#backend_flush_after = 0 # measured in pages, 0 disables
-#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
+#effective_io_concurrency = 16 # 1-1000; 0 disables prefetching
#maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching
#io_combine_limit = 128kB # usually 1-32 blocks (depends on OS)
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index 7c1e4316dde..b204e4731c1 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -152,7 +152,7 @@ extern PGDLLIMPORT bool track_io_timing;
/* only applicable when prefetching is available */
#ifdef USE_PREFETCH
-#define DEFAULT_EFFECTIVE_IO_CONCURRENCY 1
+#define DEFAULT_EFFECTIVE_IO_CONCURRENCY 16
#define DEFAULT_MAINTENANCE_IO_CONCURRENCY 10
#else
#define DEFAULT_EFFECTIVE_IO_CONCURRENCY 0