PostgreSQL Asynchronous I/O in PG 18: 7 Proven Tuning Steps

PostgreSQL asynchronous I/O arrived in PostgreSQL 18 as a new subsystem that lets a backend queue several read requests instead of waiting on each one in turn. Before this release a backend issued a read, waited for it, then issued the next. On storage where every read is a network round trip, that waiting adds up across a large scan. PG 18 changes the read path for sequential scans, bitmap heap scans and VACUUM, and the default configuration already uses it.

Teams that run large sequential scans, keep data on cloud block storage, or operate estates where VACUUM competes with production traffic should set aside time to test it. We cover what changed, the three I/O methods, the GUCs, a seven-step tuning method, monitoring, and the cases where the right move is to change nothing. Verified against PostgreSQL 18 documentation, 3 December 2026.

What PostgreSQL asynchronous I/O changes in PG 18

Through PostgreSQL 17, relation reads were synchronous. The only read-ahead under our control was prefetch advice through posix_fadvise, driven by effective_io_concurrency. The PG 17 documentation states that the setting affected bitmap heap scans only.

PostgreSQL 18 adds an AIO subsystem, and that subsystem is what PostgreSQL asynchronous I/O refers to. The PostgreSQL 18 release notes describe it as letting backends queue multiple read requests, and they name sequential scans, bitmap heap scans and vacuums as the operations that gain from it. A new server variable, io_method, selects how those reads are executed. A new system view, pg_aios, shows the I/O handles in use.

Two related changes shipped with it. effective_io_concurrency and maintenance_io_concurrency now work at values above zero on systems without fadvise() support. Both defaults also rose to 16. The optimizer and indexing changes in the same release are a separate subject, covered in our PostgreSQL 18 performance internals post.

What uses it in 18.x, and what does not

  • Sequential scans
  • Bitmap heap scans
  • VACUUM

Those three are named in the docs. The same notes speak only of read requests. They do not list writes, so we treat WAL writes, checkpointer flushes and background writer activity as unchanged in 18. Plain index scans are not in the named list either. The notes close the list with "etc.", so other read paths may gain.

Why storage latency decides the gain from PostgreSQL asynchronous I/O

Queued reads help most when each read is slow and the device can serve many at once. The docs say as much for effective_io_concurrency: higher values matter most on higher-latency storage and on devices with high IOPS. Network block storage such as Amazon EBS, Google Persistent Disk and Azure managed disks fits that description. Every read crosses a network, yet the volume accepts many in parallel.

Local NVMe sits at the other end. Reads return quickly, so there is less waiting to overlap, and CPU often becomes the limit first. Queued reads can still help there, but we expect a smaller difference and we do not assume one. A warm cache hides the effect completely, because a block already in memory needs no device read.

How it works: io_method worker vs io_uring vs sync

One setting, io_method, decides how PostgreSQL asynchronous I/O requests reach the kernel. It takes three values and, per the resource consumption settings page, can only be set at server start. The diagram shows the path a read takes under each value.

PostgreSQL asynchronous I/O architecture in PG 18 with io_method worker and io_uring

Figure 1: PostgreSQL asynchronous I/O architecture in PG 18. A backend queues reads as I/O handles, and io_method decides whether worker processes or io_uring carry them to the kernel.

io_method = worker

This is the default method for PostgreSQL asynchronous I/O. A backend hands its queued reads to a pool of I/O worker processes. The workers perform the reads while the backend keeps going, and the backend collects each result when it completes. The pool size is io_workers, which defaults to 3.

Worker mode needs no special build and no particular kernel, so it runs wherever PostgreSQL 18 runs. The trade-off is a fixed pool shared by every backend. A pool that is too small makes requests wait for a free worker.

io_method = io_uring

Here the backend submits reads straight to the Linux kernel through an io_uring submission ring and picks up results from a completion ring. There is no worker pool, so io_workers has no effect.

The requirements are stricter. The platform must be Linux. PostgreSQL must be built with liburing, using --with-liburing or -Dliburing. The kernel, the container runtime and the security policy must all allow io_uring system calls. It saves process hand-offs per read, but several managed services do not offer it.

io_method = sync

The docs define this value as executing asynchronous-eligible I/O synchronously. The backend performs each read itself. We use it for two things: as the control arm in every comparison, and as a fallback when we suspect the asynchronous path during an incident.

ModeHow I/O is issuedPlatform requirementBest fitWatch-outs
workerI/O worker processes read on behalf of backendsAny platform PostgreSQL 18 supportsDefault choice, managed services, containersSmall pool makes requests wait; needs sizing
io_uringBackend submits to kernel io_uring ringsLinux, liburing build, io_uring permittedSelf-managed Linux with scan-heavy load, after testingBlocked by seccomp or sysctl; absent on several managed services
syncBackend issues each eligible read itselfNoneControl arm in tests, incident fallbackNo queued reads

Table 1: PostgreSQL asynchronous I/O methods compared.

The GUCs that matter

Four parameters do most of the work for PostgreSQL asynchronous I/O. The defaults below come from the PostgreSQL 18 documentation. The recommendations are our starting points, and each one has to survive measurement on your own storage.

ParameterPG 18 defaultWhat it controlsReload vs restartOur starting recommendation
io_methodworkerMethod used to execute asynchronous I/ORestartKeep worker. Test io_uring only on self-managed Linux with a liburing build.
io_workers3Number of I/O worker processes; only used with workerReloadStart at 3. Raise in small steps when monitoring shows the pool is the limit.
effective_io_concurrency16Concurrent I/O a session expects storage to handle; range 1 to 1000, 0 disables asynchronous requestsNo restart; settable per session or per tablespaceKeep 16 on local NVMe. On network block storage, test higher values per tablespace.
maintenance_io_concurrency16The same idea for maintenance work done on behalf of many sessionsNo restart; settable per session or per tablespaceKeep 16 until VACUUM I/O has been measured.

Table 2: PostgreSQL asynchronous I/O parameters, with defaults as stated in the PG 18 documentation.

Three more settings exist. io_max_concurrency defaults to -1, which picks a per-process limit automatically and caps it at 64. io_combine_limit and io_max_combine_limit both default to 128kB. We leave all three at their defaults.

SELECT name,
       setting,
       unit,
       context
FROM pg_settings
WHERE name IN ('io_method',
               'io_workers',
               'effective_io_concurrency',
               'maintenance_io_concurrency',
               'io_max_concurrency',
               'io_combine_limit',
               'io_max_combine_limit')
ORDER BY name;

7 steps to tune PostgreSQL asynchronous I/O

Blast radius first. Changing io_method requires a restart, so it belongs in a maintenance window. The other settings reload or apply per session, and they reverse in seconds. Run every step on a replica or a staging copy of production before touching the primary.

PostgreSQL asynchronous I/O tuning method in seven steps for PostgreSQL 18

Figure 2: the seven steps for tuning PostgreSQL asynchronous I/O.

Step 1: Baseline

We need a storage baseline and an OLTP control before changing anything. Tuning PostgreSQL asynchronous I/O for scans must not make short transactions slower.

# Storage baseline on a scratch file. Never point fio at a data file.
fio --name=pg_randread --filename=/var/lib/postgresql/fio_scratch.dat \
    --size=8G --rw=randread --bs=8k --direct=1 --ioengine=libaio \
    --iodepth=16 --runtime=60 --time_based --group_reporting

# OLTP control. This result should not get worse in later steps.
pgbench -i -s 500 bench
pgbench -c 16 -j 4 -T 300 -P 30 -S bench
ALTER SYSTEM SET track_io_timing = on;

SELECT pg_reload_conf();

What to look for: fio completion latency percentiles and IOPS at depth 16, which tell us whether the volume serves parallel reads. From pgbench, record TPS and average latency. When to stop: when three runs agree closely.

Step 2: Confirm the build and the kernel

Only one PostgreSQL asynchronous I/O method has platform requirements, so we check them before choosing.

uname -r
pg_config --version
pg_config --configure | tr ' ' '\n' | grep -i uring
sysctl kernel.io_uring_disabled
SELECT name,
       setting,
       enumvals
FROM pg_settings
WHERE name = 'io_method';

What to look for: liburing in the configure output and io_uring in enumvals. A sysctl value of 0 means io_uring is allowed; other values restrict it, and older kernels do not have the sysctl at all. When to stop: if io_uring is missing from enumvals, that option is closed for this binary. Continue with worker.

Step 3: Choose io_method

On a managed service, or in a container platform we do not control, the answer is worker. On self-managed Linux that passed step 2, we test both methods. In every case one run uses sync, so there is a control for the PostgreSQL asynchronous I/O comparison.

Decision flow for choosing io_method for PostgreSQL asynchronous I/O

Figure 3: how we choose io_method for PostgreSQL asynchronous I/O.

ALTER SYSTEM SET io_method = 'io_uring';
-- io_method is read at server start only, so a restart follows.
# The service name varies by distribution and packaging.
sudo systemctl restart postgresql
SHOW io_method;

What to look for: the server starts and SHOW returns the new value. Keep shell access during the change, because a server that cannot initialise the chosen method may refuse to start. When to stop: if step 6 shows no difference between worker and io_uring, stay on worker. It has fewer dependencies.

Step 4: Size io_workers

This step applies only to worker. With io_uring, PostgreSQL asynchronous I/O needs no pool, so skip ahead. The value 6 below is an example, not a target.

ALTER SYSTEM SET io_workers = 6;

SELECT pg_reload_conf();

SELECT pid,
       wait_event_type,
       wait_event
FROM pg_stat_activity
WHERE wait_event = 'IoWorkerMain';

What to look for: run the query during a heavy scan. Workers waiting on IoWorkerMain are idle in their main loop. If several are idle at peak, the pool is large enough. If none are idle and backends wait on AioIoCompletion, raise the value by one or two and measure again. When to stop: when another worker no longer changes scan time.

Step 5: Set effective_io_concurrency for your storage

-- Session level, for testing.
SET effective_io_concurrency = 32;

-- Per tablespace, once a value has been proven.
ALTER TABLESPACE ts_network_block
SET (effective_io_concurrency = 32);

ALTER TABLESPACE ts_network_block
SET (maintenance_io_concurrency = 32);

What to look for: this setting is the per-session throttle on PostgreSQL asynchronous I/O. Walk a short ladder such as 16, 32 and 64, repeating step 6 at each rung. The docs warn that unnecessarily high values may increase I/O latency for all queries, so rerun the pgbench control each time. When to stop: when scan time stops improving or control latency rises. Then go back one rung.

Step 6: Validate with EXPLAIN (ANALYZE, BUFFERS)

The test table must be larger than shared_buffers, and ideally larger than RAM. Parallel query is switched off so that we compare the read path of a single backend.

CREATE TABLE aio_scan_test AS
SELECT g AS id,
       (g % 1000) AS bucket,
       md5(g::text) AS pad_a,
       repeat('x', 200) AS pad_b
FROM generate_series(1, 20000000) AS g;

VACUUM (ANALYZE) aio_scan_test;

SET max_parallel_workers_per_gather = 0;

EXPLAIN (ANALYZE, BUFFERS, TIMING)
SELECT count(*)
FROM aio_scan_test
WHERE pad_a LIKE 'ff%';

In PG 18, EXPLAIN ANALYZE includes buffer usage automatically. What to look for: a large shared read count under Buffers, the I/O Timings line, and Execution Time. If the plan shows mostly shared hit, the cache is warm and the run says nothing about PostgreSQL asynchronous I/O. When to stop: when the median of three cold runs is recorded for every configuration.

Step 7: Roll out with a rollback plan

Apply the winning PostgreSQL asynchronous I/O configuration to a replica first, then to the primary in a window. Write down the previous values before the change.

ALTER SYSTEM RESET io_method;

ALTER SYSTEM RESET io_workers;

ALTER TABLESPACE ts_network_block
RESET (effective_io_concurrency, maintenance_io_concurrency);

SELECT pg_reload_conf();
-- io_method returns to worker only after the next restart.

If the server does not start after an io_method change, remove that line from postgresql.auto.conf in the data directory and start it again. When to stop: when production monitoring over a full business cycle matches what staging showed. Test every change outside production first, and keep backups and disaster recovery in working order.

Monitoring PostgreSQL asynchronous I/O with pg_aios and pg_stat_io

Two views cover PostgreSQL asynchronous I/O in production. pg_aios lists the I/O handles in use right now, one row per handle. Reading it requires superuser or membership of pg_read_all_stats.

SELECT state,
       operation,
       target,
       count(*) AS handles,
       sum(length) AS bytes_in_flight
FROM pg_aios
GROUP BY state,
         operation,
         target
ORDER BY handles DESC;

pg_stat_io holds the cumulative picture by backend type, object and context. Two contexts matter here: bulkread, which covers large reads such as a sequential scan of a big table, and vacuum. The read_bytes column is new in 18, and read_time is populated only when track_io_timing is on.

SELECT backend_type,
       object,
       context,
       reads,
       read_bytes,
       round(read_time::numeric, 1) AS read_time_ms,
       hits,
       evictions
FROM pg_stat_io
WHERE reads > 0
ORDER BY read_bytes DESC;

-- Reset between test runs.
SELECT pg_stat_reset_shared('io');

Healthy versus saturated

On a healthy system pg_aios is empty or shows short-lived rows, mostly readv operations in the SUBMITTED state. Some I/O workers sit in IoWorkerMain. The ratio of read_time to reads in pg_stat_io holds steady from one sample to the next.

Saturation looks different. Handles pile up between samples. No worker is idle. Backends wait on AioIoCompletion, and time per read climbs. Once device latency itself is rising, storage is the limit, and raising PostgreSQL asynchronous I/O concurrency further only adds pressure.

Wait events to watch

These are the PostgreSQL asynchronous I/O wait events documented for 18, with one plain read event for contrast.

SELECT wait_event_type,
       wait_event,
       count(*) AS sessions
FROM pg_stat_activity
WHERE wait_event IN ('AioIoCompletion',
                     'AioIoUringSubmit',
                     'AioIoUringExecution',
                     'AioUringCompletion',
                     'AioWorkerSubmissionQueue',
                     'IoWorkerMain',
                     'DataFileRead')
GROUP BY wait_event_type,
         wait_event
ORDER BY sessions DESC;

Benchmarking method (how to measure your own gain)

We publish the method and no numbers. The gain from PostgreSQL asynchronous I/O depends on storage, cache state and query.

  1. Use the same hardware, instance type and volume for every configuration.
  2. Change one parameter per configuration.
  3. Measure cold cache and warm cache separately, and label each result.
  4. Drop caches between cold runs.
  5. Run each configuration three times and take the median. Record the spread as well.
  6. Report latency percentiles for the OLTP control, not only the average.
# Test hosts only. Dropping caches on production slows every query.
sudo systemctl stop postgresql
sync
echo 3 | sudo tee /proc/sys/vm/drop_caches
sudo systemctl start postgresql

Managed services give no access to the operating system. Restart the instance instead. The pg_buffercache extension in PG 18 also provides pg_buffercache_evict_relation(), which empties shared buffers for one relation but leaves the OS page cache alone.

ConfigurationCold median (ms)Warm median (ms)Control p95 (ms)Notes
io_method = syncyour resultyour resultyour resultControl arm
worker, io_workers = 3your resultyour resultyour resultPG 18 defaults
worker, tuned io_workersyour resultyour resultyour resultValue from step 4
io_uringyour resultyour resultyour resultOnly if step 2 passed
Chosen method, tuned effective_io_concurrencyyour resultyour resultyour resultValue from step 5

Table 3: PostgreSQL asynchronous I/O benchmark template. Fill it with your own medians.

Pitfalls and when not to change anything

Containers and kernels without io_uring

A seccomp profile can deny the io_uring system calls, and a sysctl can disable them for the whole host. Run step 2 inside the same image, runtime and security policy that production uses. Where io_uring is blocked, worker still delivers PostgreSQL asynchronous I/O.

Managed services

The provider decides which PostgreSQL asynchronous I/O values are accepted. This is what we could confirm in provider documentation.

  • Azure Database for PostgreSQL flexible server: its supported versions page states that io_method = io_uring cannot be configured on version 18.
  • AlloyDB for PostgreSQL: the database flags reference lists io_method for PostgreSQL 18 and says only sync and worker are supported.
  • Cloud SQL for PostgreSQL: io_method and io_workers are listed among the PostgreSQL 18 flags. Confirm the accepted values on the database flags page.
  • Amazon RDS and Amazon Aurora: we could not confirm the accepted values in AWS documentation. Check your provider's parameter group.

Over-sized io_workers

More workers than the device can serve brings no gain. It adds processes and can raise device latency for every session.

Workloads that are CPU-bound, not I/O-bound

If plans show buffer hits and few reads, or the CPUs are saturated while the disks are quiet, there is nothing for PostgreSQL asynchronous I/O to speed up. A fully cached OLTP system belongs in this group. Leave the defaults.

Upgrade-day checklist

Upgrading to 18 switches PostgreSQL asynchronous I/O on, so these items belong on the day's runbook.

  • Record the current effective_io_concurrency and maintenance_io_concurrency. An explicit value in postgresql.conf carries over and overrides the new default of 16.
  • After the upgrade, run SHOW io_method; and expect worker.
  • Fix monitoring that reads pg_stat_io.op_bytes. The column was removed in 18; use read_bytes, write_bytes and extend_bytes.
  • Run step 6 before and after, on the same data.
  • Review autovacuum settings at the same time; our PostgreSQL 18 vacuum tuning notes cover that side.
  • Estates moving past 18 can use our PostgreSQL 19 release and upgrade steps for sequencing.

FAQ: PostgreSQL asynchronous I/O

Is PostgreSQL asynchronous I/O on by default?

Yes. In PostgreSQL 18, io_method defaults to worker with three I/O worker processes, and effective_io_concurrency defaults to 16. An upgraded cluster uses the new read path for eligible operations with no configuration change. Setting io_method = sync makes those reads synchronous again, and effective_io_concurrency = 0 stops asynchronous requests from being issued.

Do I need io_uring for PostgreSQL asynchronous I/O?

No. The default worker method needs no particular kernel and no special build. The io_uring method is optional. It is Linux-only, needs PostgreSQL built with liburing, and needs an environment that permits io_uring system calls. We treat it as something to test on self-managed Linux, and we stay on worker when measurements show no difference.

Does PostgreSQL asynchronous I/O speed up writes?

Not according to the PostgreSQL 18 documentation. The release notes describe queueing read requests and name sequential scans, bitmap heap scans and vacuums. They do not list WAL writes, checkpoints or background writer flushes. A write-heavy system can still gain indirectly when VACUUM finishes its reads sooner. Commit latency has to be tuned through other settings.

Does PostgreSQL asynchronous I/O work on Amazon RDS?

Amazon RDS for PostgreSQL supports major version 18, starting with 18.1, so the subsystem is present there. We could not confirm from AWS documentation which io_method values RDS accepts. Check the parameter group for your engine version before planning a change. Expect worker, and do not plan on io_uring unless the parameter group lists it.

How MinervaDB helps

MinervaDB runs PostgreSQL in production for 900+ enterprises, with 15+ years of company depth in database performance work. Our PostgreSQL 18 upgrade assessments cover parameter carry-over, storage behaviour and monitoring changes before the cutover date. Our performance engineering follows the method in this post: baseline, change one setting, measure, keep a rollback. After go-live, our 24x7 support team handles incidents and the tuning that follows them. For a second opinion on an upgrade plan or on PostgreSQL asynchronous I/O for a scan-heavy workload, talk to our PostgreSQL consulting and support team.

About MinervaDB Corporation 389 Articles
MinervaDB is a vendor-neutral, full-stack database infrastructure company for the enterprise. We cover architecture, engineering, operations, production engineering and FinOps, unified with Data Engineering, Data Analytics and Data Science, across PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, Db2, MongoDB, ClickHouse, Redis and every major cloud DBaaS on AWS, Azure and Google Cloud. One accountable team owns the entire database lifecycle: architecture designed to be correct at scale, automated and hardened engineering, 24x7 operations with reliability we measure, and analytics that turn data into decisions. Our practice covers performance engineering, capacity planning and scalability, high availability and disaster recovery, observability, security and compliance, migration and modernization from Oracle and Db2, and Cloud FinOps for Snowflake, Databricks, BigQuery, AlloyDB, Cloud SQL, Aurora, RDS and Azure. We also work on SAP HANA, Trino, Apache Cassandra, Valkey and Milvus. Our Data Science and AI practice builds analytics platforms, production machine learning and private generative AI. 900+ enterprises rely on MinervaDB, including Global Capability Centers and teams in financial services, telecommunications, retail, healthcare, SaaS and manufacturing. Our engagements are staffed by senior engineers only, with knowledge transfer by default.