PostgreSQL 18 Beta 1 io_max_concurrency

Started by Jafri, Nazneen11 months ago2 messageshackers
Jump to latest
#1Jafri, Nazneen
nazjafri@amazon.com

Hello,

The default setting of parameter io_max_concurrency shows 64 whereas the documentation says -1, checking if this is the expected behavior.

PG 18 documentation says:
The default setting of -1 selects a number based on shared_buffers<https://www.postgresql.org/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS&gt; and the maximum number of processes (max_connections<https://www.postgresql.org/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS&gt;, autovacuum_worker_slots<https://www.postgresql.org/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-WORKER-SLOTS&gt;, max_worker_processes<https://www.postgresql.org/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES&gt; and max_wal_senders<https://www.postgresql.org/docs/18/runtime-config-replication.html#GUC-MAX-WAL-SENDERS&gt;), but not more than 64.

https://www.postgresql.org/docs/18/runtime-config-resource.html#GUC-IO-MAX-CONCURRENCY

postgresql.conf (also says -1)

#io_max_concurrency = -1 # Max number of IOs that one process
# can execute simultaneously
# -1 sets based on shared_buffers # (change requires restart)

But the default setting in the database instance is 64
postgres=# show io_max_concurrency;
io_max_concurrency
--------------------
64
(1 row)

Even after explicitly changing to -1 and restart, the setting is not getting reflected, is there any other dependency we could be missing?

postgres=# alter system set io_max_concurrency=-1;
ALTER SYSTEM
waiting for server to shut down.... done
server stopped
waiting for server to start.... done
server started
[postgres]$ psql
psql (18beta1)
Type "help" for help.

postgres=# show io_max_concurrency;
io_max_concurrency
--------------------
64
(1 row)

Interestingly, it accepts values besides -1, including unexpected ones like 100/200 (contrary to the documentation max 64).

postgres=# show io_max_concurrency;
io_max_concurrency
--------------------
100
(1 row)
postgres=# alter system set io_max_concurrency=200;
ALTER SYSTEM
postgres=#
waiting for server to shut down.... done
server stopped
waiting for server to start.... done
server started
[postgres]$ psql
psql (18beta1)
Type "help" for help.

postgres=# show io_max_concurrency;
io_max_concurrency
--------------------
200
(1 row)

Thank you,
Nazneen

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jafri, Nazneen (#1)
Re: PostgreSQL 18 Beta 1 io_max_concurrency

"Jafri, Nazneen" <nazjafri@amazon.com> writes:

The default setting of parameter io_max_concurrency shows 64 whereas the documentation says -1, checking if this is the expected behavior.

I think it's behaving as designed: the bootstrap default is indeed -1, but
later in startup there is an an auto-tuning step that replaces that with
a number chosen as stated in the docs (which evidently comes out as 64
on your system).

There are other auto-tuned GUCs that behave similarly. We could leave the
user-exposed setting as "-1", but it was argued that that was unhelpful
compared to exposing the value chosen by auto-tuning.

regards, tom lane