Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4862 pages

Databases and servers

PostgreSQL 18 asynchronous I/O and io_method: worker, io_uring or sync

In short

PostgreSQL 18 asynchronous I/O lets a backend queue several read requests at once, and the io_method setting picks how: worker (the default, using I/O worker processes), io_uring (only in builds made with liburing) or sync. It helps sequential scans, bitmap heap scans and vacuum, and changing it needs a server restart.

What PostgreSQL 18 asynchronous I/O changes

The 18.0 release notes, dated 2025-09-25, describe the new subsystem as letting backends queue multiple read requests, which makes sequential scans, bitmap heap scans and vacuums more efficient. The release announcement names the same three operations and says benchmarks showed gains of up to 3x in certain scenarios. That figure is the project's own and comes with no workload attached, so treat it as a ceiling seen somewhere, and measure your own tables.

Two smaller changes ship with it. The defaults of effective_io_concurrency and maintenance_io_concurrency went up to 16, and values above zero now work on systems that lack fadvise() support, because the read-ahead goes through the new subsystem. A new system view, pg_aios, lists the I/O handles in use at that moment.

Checked against: source 2, source 3, source 4

The three io_method values and when each one applies

The setting lives in the resource consumption chapter of the server configuration docs. It can only be set at server start, so a reload does nothing and a restart is part of any change. The table repeats what the documentation says about each value; the last column is the narrow decision rule those pages support.

The build pages are short on detail. They say the liburing option enables io_uring support and that the meson option defaults to auto, which turns it on when the library is found. Neither page names an operating system or a minimum library version. If you run distribution or vendor packages, ask the packager whether liburing was enabled, then try io_method = io_uring on a test machine and read the server log at start before touching production.

Anything past the table is outside the docs. I have not benchmarked worker against io_uring, so I would not switch away from the default because of a blog chart; I would switch only after a test on my own hardware shows a difference on my own queries.

ValueWhat the docs say it doesRequirementPick it when
workerRuns asynchronous I/O in separate I/O worker processesNone stated; it is the defaultYou want the 18 behavior with no build questions
io_uringRuns asynchronous I/O through io_uringA build made with --with-liburing (make) or -Dliburing (meson)Your packages were built with liburing and you will test it
syncRuns I/O that could be asynchronous synchronouslyNone statedYou want to rule the new path out while you chase a problem

Checked against: source 1, source 5, source 6

io_workers and the other asynchronous I/O settings

A handful of related settings decide how much work the subsystem takes on. Their defaults in the 18 docs are in the table at the end of this section.

The combine limits catch people out. Raising io_combine_limit alone does nothing past 128kB, because the lower of the two values wins without any warning. Both need to go up together, and io_max_combine_limit needs a restart. The docs give the limits in blocks when no unit is written, which is usually 8kB per block.

The io_max_concurrency cap of 64 applies to one process, and the computed default can come out lower than that, since it is derived from shared_buffers and the counts behind max_connections, autovacuum_worker_slots, max_worker_processes and max_wal_senders.

SettingDefaultRestart neededNotes from the docs
io_workers3No; set in postgresql.conf or on the command lineOnly has an effect with io_method = worker
io_max_concurrency-1 (computed)YesPicks a number from shared_buffers and the process limits, capped at 64
io_combine_limit128kBNot stated; user-settableSilently capped by io_max_combine_limit
io_max_combine_limit128kBYesTypical maximum is 1MB on Unix and 128kB on Windows
effective_io_concurrency16Not statedRange 1 to 1000, or 0 to stop issuing asynchronous requests
maintenance_io_concurrency16Not stated; tablespace can overrideUsed for maintenance work done for many sessions

Checked against: source 1

What io_method does not speed up

Every gain the release notes and the announcement list is a read: scans, bitmap heap scans and vacuum. Neither page promises faster commits, faster WAL flushing or quicker index inserts, so a write heavy workload should not expect a change from switching io_method.

The pg_aios view does define a writev operation alongside readv, so the subsystem has a write path in its vocabulary. The documentation I read does not say which writes use it in 18, and I would not guess.

Small, cached workloads have little to gain for a plainer reason. If the pages are already in shared_buffers, no read goes to the disk and there is nothing to queue.

Checked against: source 2, source 3, source 4

How to check the io_method setting and watch it work

A short checklist that sticks to what the docs describe:

  • Run SHOW io_method; and SHOW io_workers; to see what the server is using now. After an upgrade from 17, expect worker and 3 unless someone set them.
  • To change the method, set it in postgresql.conf or with ALTER SYSTEM SET io_method = 'io_uring';, then restart. If the new value never takes effect, the page on postgresql.conf settings that report errors and do not apply shows how to read pg_file_settings.
  • While a large scan runs, query SELECT pid, state, operation, length, result FROM pg_aios;. It returns one row per handle in use. The view is readable by superusers and members of pg_read_all_stats by default.
  • Watch the result column. PARTIAL means the I/O finished but did not cover all the data and the caller will retry the rest; ERROR means it failed.
  • Keep the old value written down so you can go back with one more restart.
  • The docs call pg_aios mainly useful to PostgreSQL developers, though possibly useful for tuning, so use it to confirm that asynchronous reads happen. Timing still has to come from your own query plans.

Checked against: source 1, source 4

Where this fits in a PostgreSQL 18 move

Most servers meet asynchronous I/O during a major upgrade, since the default is already on. The PostgreSQL 18 pg_upgrade notes on what changes and what breaks cover the checksum and statistics changes that matter more on day one, and the notes on uuidv7() and NOT NULL NOT VALID cover the schema features. Other database posts sit on the engineering hub, including the default isolation level comparison of MySQL and PostgreSQL.

These facts were read on 29 Nov 2026 from the PostgreSQL 18 docs. Before acting, re-check the release notes of the newest 18.x minor release, since defaults and limits can be adjusted there. For a team that wants slow queries looked at with the new settings in mind, the database performance plan describes that work.

Checked against: source 1, source 2

What else do people ask?

What is the default io_method in PostgreSQL 18?

worker. Asynchronous I/O runs through I/O worker processes, three of them by default, controlled by io_workers.

Do I need io_uring to get PostgreSQL 18 asynchronous I/O?

No. The default worker method already gives asynchronous reads. io_uring is a second method that only exists in builds compiled with liburing.

Can I change io_method without a restart?

No. The docs say it can only be set at server start. io_workers carries no start-only note; the docs say it is set in postgresql.conf or on the server command line.

How do I turn asynchronous I/O off in PostgreSQL 18?

Set io_method to sync and restart. I/O that could be asynchronous then runs synchronously, which is the closest match to the old behavior.

Which queries get faster with asynchronous I/O?

The release notes and announcement name sequential scans, bitmap heap scans and vacuum. They make no promise for writes or for data that is already cached in shared_buffers.

Who can read the pg_aios view?

By default only superusers and roles with the privileges of pg_read_all_stats.

Sources

Keep reading

Next step

Have a project in mind?

Tell me about it. A discovery call within 48 hours.