diff options
author | Thomas Munro <tmunro@postgresql.org> | 2025-03-19 15:23:12 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2025-03-19 15:40:35 +1300 |
commit | 06fb5612c970b3af95aca3db5a955669b07537ca (patch) | |
tree | a3cfb560033bfd70e68f72e8d58ddc99250f5afb /src/backend/utils/misc/postgresql.conf.sample | |
parent | 10f6646847515b1ab02735c24b04abaf1996f65f (diff) | |
download | postgresql-06fb5612c970b3af95aca3db5a955669b07537ca.tar.gz postgresql-06fb5612c970b3af95aca3db5a955669b07537ca.zip |
Increase io_combine_limit range to 1MB.
The default of 128kB is unchanged, but the upper limit is changed from
32 blocks to 128 blocks, unless the operating system's IOV_MAX is too
low. Some other RDBMSes seem to cap their multi-block buffer pool I/O
around this number, and it seems useful to allow experimentation.
The concrete change is to our definition of PG_IOV_MAX, which provides
the maximum for io_combine_limit and io_max_combine_limit. It also
affects a couple of other places that work with arrays of struct iovec
or smaller objects on the stack, so we still don't want to use the
system IOV_MAX directly without a clamp: it is not under our control and
likely to be 1024. 128 seems acceptable for our current usage.
For Windows, we can't use real scatter/gather yet, so we continue to
define our own IOV_MAX value of 16 and emulate preadv()/pwritev() with
loops. Someone would need to research the trade-offs of raising that
number.
NB if trying to see this working: you might temporarily need to hack
BAS_BULKREAD to be bigger, since otherwise the obvious way of "a very
big SELECT" is limited by that for now.
Suggested-by: Tomas Vondra <tomas@vondra.me>
Discussion: https://postgr.es/m/CA%2BhUKG%2B2T9p-%2BzM6Eeou-RAJjTML6eit1qn26f9twznX59qtCA%40mail.gmail.com
Diffstat (limited to 'src/backend/utils/misc/postgresql.conf.sample')
-rw-r--r-- | src/backend/utils/misc/postgresql.conf.sample | 4 |
1 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 66bda60f4ca..6abd1baeac8 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -200,9 +200,9 @@ #backend_flush_after = 0 # measured in pages, 0 disables #effective_io_concurrency = 16 # 1-1000; 0 disables prefetching #maintenance_io_concurrency = 16 # 1-1000; 0 disables prefetching -#io_max_combine_limit = 128kB # usually 1-32 blocks (depends on OS) +#io_max_combine_limit = 128kB # usually 1-128 blocks (depends on OS) # (change requires restart) -#io_combine_limit = 128kB # usually 1-32 blocks (depends on OS) +#io_combine_limit = 128kB # usually 1-128 blocks (depends on OS) #io_method = worker # worker, sync (change requires restart) #io_max_concurrency = -1 # Max number of IOs that one process |