Asynchronous I/O in PostgreSQL 18

PostgreSQL 18 added asynchronous I/O, which can change how read-heavy workloads use storage. This page explains io_method, io_workers and combined limits, and how to benchmark a before and after comparison before you change settings in production.

On this page

What asynchronous I/O in PostgreSQL 18 changes for read-heavy workloads

If your self-hosted PostgreSQL team runs read-heavy workloads and is weighing PostgreSQL 18, the question is whether asynchronous I/O is worth enabling. It is a server-level change to how the database issues reads, and its effect depends on your storage, your workload and the kernel support on each host, so you need to measure it before relying on it. The PostgreSQL 18 release announcement lists asynchronous I/O among its additions, alongside an OAuth 2.0 authentication method, the uuidv7() function, virtual generated columns by default, and the deprecation of MD5 password authentication in favor of SCRAM. Treat the I/O change as one item in that list, not as a switch that improves every read path.

The feature ships in the same release as several pg_upgrade improvements, and the two are easy to blur during planning. PostgreSQL 18 pg_upgrade retains planner statistics across major upgrades and adds parallel jobs and a --swap option. Those changes affect the upgrade process and the first queries after it, not I/O behavior, so keep the two tests separate. Run the upgrade on a copy of production and check plans and timings with asynchronous I/O at its default. Then change the I/O settings in a second run. If you change both at once, you cannot tell which one caused a regression.

Plan a dedicated benchmark before touching I/O settings if your working set is larger than shared_buffers, your data sits on network-attached or cloud block storage, your hosts run kernels whose io_uring support you have not verified, or your service has a latency target that a read regression would break. The settings to review are io_method, which selects the implementation, and io_workers, which applies when the worker method is in use. Confirm the supported values, defaults and kernel requirements in the PostgreSQL 18 documentation and on your own hardware before the test, since they vary by platform and build.

Where asynchronous I/O changes a read, and where it does not

The walk starts at a client query, whose backend process checks the shared buffer cache first. Only a miss reaches the I/O layer, where io_method selects worker, io_uring or sync. With worker, the request is handled by the pool sized by io_workers. The pages then come back from the storage layer into the shared buffer cache, and the backend reads the buffer. Check the io_method setting on your build and the wait events during a read-heavy test. A cache hit skips this path entirely.

The I/O method only handles cache misses; the buffer cache and storage layer are unchanged.

Which io_method and I/O settings fit which workload

This table compares the io_method options (worker, io_uring and sync) and the limits that bound concurrent I/O, showing when each fits and what it depends on. Read each row against your build, kernel and storage, then confirm allowed values and defaults in the PostgreSQL 18 configuration reference for your exact build before changing anything.

Option or settingWhen it fitsWhat it depends onMain trade-off
io_method = syncBaseline runs, a fallback during investigation, or hosts where you want I/O to behave as in earlier major versionsNothing beyond the standard build; the closest match to pre-18 behaviorReads stay synchronous, so read-heavy sessions wait on each request in turn
io_method = workerA general-purpose default for read-heavy workloads on common Linux, BSD and other platforms where io_uring is not available or not chosenAvailable in the standard build; concurrency depends on io_workers and storage that can serve parallel requestsAdds background I/O worker processes that consume CPU and need sizing; gains depend on storage behavior
io_method = io_uringLinux hosts with a recent enough kernel and a build compiled with io_uring support, where you want lower per-request overheadBuild flags, kernel support and container or seccomp policies that permit io_uring; confirm each against your distributionHarder to support: kernel and policy dependencies can block startup or fall back, and security teams may restrict it
io_workersTuning the number of background I/O workers when io_method is workerCore count, storage queue depth and the concurrency your read pattern actually producesMore workers raise parallel reads but add CPU contention and can hurt latency for OLTP sessions
Combining limits (max_connections, max_worker_processes, io_workers)Checking that worker-based I/O does not exhaust process slots needed for backends, autovacuum and parallel queryTotal process counts and how many background workers your other features already useRaising one limit without budgeting others can cause startup failures or queued work
Storage type (local NVMe, SAN, network volumes)Deciding whether asynchronous reads are likely to help, based on how the storage serves parallel requestsDevice queue depth, cache layers and whether reads hit the OS page cacheGains on fast local storage can be small, and network storage can behave differently under concurrency

Choosing an io_method for your platform and storage

Where your Linux hosts run a kernel and PostgreSQL build that support io_uring, it is the method worth testing first, but only as a candidate. Asynchronous I/O is a feature of PostgreSQL 18, and a server can be configured for io_uring and still fall back or fail, depending on how the binaries were compiled and what the host permits.

  • Build support: Confirm that your PostgreSQL 18 binaries were compiled with io_uring support, using your distribution's package notes or your own build flags.
  • Kernel and distribution: Check that the kernel on each database host supports io_uring and that your distribution has not disabled it through its defaults or security settings.
  • Container and sandbox limits: Verify that container runtimes, seccomp profiles and hardened kernel settings allow the system calls io_uring needs.
  • Concurrent read behavior: Run read-heavy tests at the concurrency your application produces, compare throughput and latency against sync on identical hardware, and repeat each run several times.
  • Active method check: After startup, confirm the io_method the server reports and check the logs, so you know which method actually ran.

Keep sync in the same test as the reference, and check the build, kernel and active io_method together before you record any result.

Setting up asynchronous I/O on a test cluster first

This sequence gives you a test cluster that matches production closely enough to measure how io_method and io_workers change read behavior before any production setting is touched. Each change is made alone, verified in the server's own view of its configuration, and compared against a recorded baseline.

  1. Copy the production configuration to a test cluster

    The database administrator builds a non-production cluster on the same PostgreSQL 18 build that production runs, then copies the production postgresql.conf and any included configuration files. Load a dataset that is representative of production, such as a recent restored copy, so the buffer cache and table sizes behave similarly. Confirm the build with postgres --version on both hosts and check that SHOW server_version returns the same release on the test cluster. The step is done when the test server starts with the copied settings and no configuration errors appear in the server log.

  2. Confirm the storage path matches production

    The platform engineer checks that the test cluster reads from storage with the same characteristics as production. Compare the filesystem type, mount options, device type, RAID or cloud volume class, and the Linux kernel version using findmnt, lsblk and uname -r. Asynchronous I/O results depend heavily on the storage path, so a test on a faster or differently cached volume will not predict production behavior. Record the comparison in the test notes. The step is done when every difference is either removed or written down with its expected effect.

  3. Record the baseline with sync I/O

    Before changing anything, set io_method to sync in the test configuration and confirm it is active with SHOW io_method. Run the read-heavy workload you want to improve, using queries replayed from production or a custom script that mirrors them, and record throughput, latency percentiles and error counts. Save the pg_stat_io view alongside these results so later runs can be compared at the same level of detail. The step is done when at least one full baseline run is saved with the configuration file and the server log for that run.

  4. Change io_method to worker and restart

    The database administrator changes only io_method to worker in the test configuration. Check the parameter's context in pg_settings, since the context column shows whether a reload or a full restart is needed, and restart the test cluster if the documentation requires it for this setting. After the restart, run SELECT name, setting, source, pending_restart FROM pg_settings WHERE name = 'io_method'; and confirm the value is worker with pending_restart set to false. The step is done when the setting is active and the server log shows a clean startup.

  5. Set io_workers as a single change

    Change io_workers on its own, and only after the worker method is confirmed active. Apply the value, reload or restart according to the parameter's context, and verify it with the same pg_settings query, checking the setting and source columns. Keep the value small and change it in steps between runs, so any difference in results can be traced to one number. Do not change connection limits, memory settings or other I/O parameters during the same run. The step is done when the active value matches what was written in the test notes.

  6. Test io_uring only where the build supports it

    Set io_method to io_uring only if the PostgreSQL build and the Linux kernel on the test host both support it. Confirm support with the platform team and the packaging documentation for your build before the change, because an unsupported setting can prevent startup. Restart, then check pg_settings and the server log for startup messages about the I/O method. Repeat the same workload used for the baseline. The step is done when the setting is confirmed active, or when the reason it cannot be used is recorded and the team has chosen worker or sync for the next comparison.

  7. Review the server log and active settings

    After each change, the database administrator reviews the PostgreSQL server log for warnings, errors or repeated I/O-related messages from the test run, and compares the active settings with the intended settings. Use pg_settings to confirm setting, source and pending_restart for each changed parameter, and check that no parameter is waiting for a restart. Any unexpected entry in the log is investigated before the next run, because it can make benchmark results misleading. The step is done when the log is clean for the run or each entry is explained in the test notes.

  8. Compare each run against the baseline

    Repeat the workload for each configuration and compare throughput, latency and pg_stat_io counters with the saved sync baseline. Use the same dataset state, the same client count and the same run length for every comparison, and note any run where the cache was warmed differently. Decide which settings to carry into the production planning step only if the results are repeatable across more than one run. The step is done when a written comparison shows each setting, its measured effect and the storage path it was measured on.

How to benchmark before and after a PostgreSQL 18 upgrade

A fair comparison of PostgreSQL 18 asynchronous I/O needs two environments that differ in one controlled way at a time. Load the same data volume on both sides, replay a query mix captured from production rather than a synthetic test, hold client concurrency constant, and run each configuration both cold (after restarting the server and clearing the operating system cache) and warm. Record the io_method and io_workers values with every result. Without those records, a later reader cannot tell which run produced which number. Confirm the exact cache-clearing and restart steps with your storage team, since they depend on the host and on whether the database sits behind a shared SAN.

Capture query latency and throughput from the client side, then pull the top statements from pg_stat_statements before and after each run, ranked by total time and by mean time. Compare the same query IDs across both sides, because a query that gets faster in aggregate may still regress at the tail. On the host, record I/O wait and device queue depth for the whole run so you can see whether the database is actually waiting on storage. If I/O wait does not move when io_method changes, asynchronous I/O is not your bottleneck, and the change will not help.

A major upgrade changes more than the I/O path. The planner in PostgreSQL 18 may choose different plans, and that alone can move latency in either direction. Run the baseline on the old version, then benchmark PostgreSQL 18 with io_method set to sync before testing worker or io_uring, so the version effect is measured separately from the I/O effect. Note that pg_upgrade in PostgreSQL 18 retains planner statistics, so the new cluster starts with the statistics the old one had. Check that ANALYZE has run on the migrated database before you measure, or you will benchmark stale plans. Confirm this behavior against the PostgreSQL 18 release announcement and your own upgrade test.

Security and operational risks of changing I/O settings

Changing how PostgreSQL 18 issues I/O touches the database, the host and the people who run both. The cards below cover the controls that keep a change reversible, observable and auditable, and the checks that stop an upgrade from quietly invalidating backups or monitoring.

Rollback path before the primary changes

Asynchronous I/O is set through io_method and io_workers, and the value applies at server start, so a bad choice means a restart on a production primary. Before changing it, record the current values, confirm a tested restart plan, and stage the change on a standby or a copy of the cluster first. Keep a written step that returns both settings to their previous values.

High availability docs

io_uring availability after host patches

The io_uring method depends on the kernel and on how the build was compiled, so a host patch or kernel swap can change whether it is available. Check the server log after every patch window and confirm which io_method is active. Treat a silent fall back as a configuration drift event that needs a ticket, not a surprise discovered during a slowdown.

Monitoring blind spots when I/O wait moves

Dashboards built on older wait events may under-report or misattribute time once reads are issued asynchronously. Before the change, capture baseline I/O wait, buffer read and query latency metrics. After it, compare the same panels for the same workload and confirm that alerts still fire on the metrics they were written for.

Limit configuration rights to operations

Settings such as io_method, io_workers and the host's kernel parameters can all change I/O behavior, and they sit in different places: the server configuration, the operating system and the service unit. Restrict changes to a named operations role, require peer review for each change, and keep application accounts without superuser or host access. Log every change with who made it and why.

Backups and restore tests after upgrade

An upgrade to PostgreSQL 18 does not prove that the backup chain still works. Confirm that base backups and archived WAL from the new major version restore cleanly, and run a point-in-time recovery test into a scratch environment with the 18 binaries. Repeat the restore test after I/O tuning so the recovery procedure matches the configuration you run in production.

Continuous archiving docs

Change records for audit

Auditors and change boards will ask what changed, when, why, what was tested and how it was reversed. Keep a change record that includes the before and after values, the benchmark results used to justify the change, the approver and the post-change checks. Store it with the configuration in version control so the history is reviewable alongside other database changes.

What does tuning asynchronous I/O cost, and what does it need from our team?

What drives the cost of an asynchronous I/O test?

The main driver is how much work it takes to build a fair comparison, not the number of settings you try. The cost depends on environment parity (how closely the test hardware, storage, operating system and PostgreSQL settings match production), the number of workloads you need to represent, how much benchmark scripting is required, and how many configurations are compared. Each added workload or configuration adds runs, analysis and reporting. A quote should state which of these are in scope, which environment will be used, and how results will be delivered. DeployOpen does not publish a price list, and a quote follows from the written scope.

How long does an asynchronous I/O benchmark take?

Duration depends on scope rather than on a fixed figure. The main variables are the number of workloads, whether a production query sample is available, how much custom benchmark scripting is needed, how many io_method and io_workers combinations are compared, and how many repeated runs are needed to separate real effects from noise. Environment provisioning and access approvals often take longer than the runs themselves. Ask for a written timeline that lists each phase and the client inputs each phase depends on.

What does our team need to provide for the comparison?

Expect to provide four things. First, test hardware or cloud capacity that matches production storage closely enough to be meaningful, and ideally a way to repeat runs on the same setup. Second, a sample of production queries or the query mix that represents read-heavy traffic. Third, access to pg_stat_statements in the source environment so the top queries can be ranked by total and mean time. Fourth, maintenance windows for restarts, since changing io_method requires a server restart. Confirm these inputs before the engagement starts, because missing ones are the most common cause of delay.

Can our internal team run the before and after comparison alone?

Yes, if the team has the time, benchmark experience and an environment that resembles production. Internal teams usually handle the baseline on the current major version well, since they know the workload. The harder parts are writing workload scripts that reflect real traffic, controlling noise from shared hardware, keeping settings identical across runs, and reading latency and throughput results without drawing conclusions from a single run. Many teams do the setup internally and ask a partner to review the method and results, or the reverse. Decide early which steps your team will own so nobody assumes someone else is doing them.

Is asynchronous I/O testing a one-time cost or a recurring one?

The first comparison is one-time work: it establishes whether io_method and io_workers settings help your workload on your hardware. It recurs when conditions change, for example before each major upgrade, after a storage or kernel change, or when query patterns shift. Some teams keep a repeatable benchmark suite so each upgrade reuses the scripts and only refreshes the query sample. Ongoing testing can be scoped as a retainer covering periodic retests. Ask whether the scripts, configuration records and results will be handed over, so future comparisons do not depend on the same provider.

What does the work produce, and can we keep it?

A typical deliverable includes the benchmark scripts, the configurations tested, the hardware and storage description, the raw and summarized results, and a recommendation for io_method and io_workers with the trade-offs stated. Ask for these items in the written scope so they are owned by your organization and can be rerun. Also ask how the recommendation will be validated after go-live, since production behavior can differ from a test environment. Retesting after a PostgreSQL minor or major upgrade should be listed separately from the initial comparison.

Does the comparison touch production data or create security exposure?

It can, depending on how the test is set up. Benchmarks should run on a copy or a representative dataset, not directly on production. Production query samples may contain sensitive values, so ask for them to be sanitized or limited to query text and statistics before they leave your environment. Access to pg_stat_statements and test hosts should follow your existing access controls, and test credentials should be removed after the engagement. Agree these rules in the written scope before any data moves.

Limits to confirm in your environment before enabling it

PostgreSQL 18 asynchronous I/O changes how reads reach storage, so the benefit and the risk depend on your build, kernel, storage and workload. The cards below list the checks to finish before you change io_method on a production cluster. Confirm each one against the PostgreSQL 18 documentation and your own test results, not against general expectations.

Supported io_method values

Start by confirming which io_method values your PostgreSQL 18 build and operating system accept. The setting offers the worker, io_uring and sync choices, but the io_uring option depends on build options and on Linux support, so a package built without it will not offer it. Record the exact value from SHOW io_method; on each node, because a standby or replacement server built differently can behave differently after failover.

Upgrade docs

Kernel behavior for io_uring

The io_uring path depends on your kernel version, its io_uring support and any container or security profile that restricts the system calls it uses. Confirm that the kernel on every node exposes the interface and that your hardening policy does not block it. Test after every kernel update, since a kernel change can alter behavior without any PostgreSQL change.

Storage type and its effect

The benefit of asynchronous reads depends on where the data lives. Local NVMe, SAN, network block storage and managed volumes each add different latency and queueing behavior, and a managed volume may throttle IOPS in ways the database cannot see. Measure I/O latency on the exact volume type you plan to use, rather than assuming that a faster device gives the same result.

Read-heavy workload fit

Asynchronous I/O mainly helps workloads that read data from disk, such as large scans or many cache misses. A cluster whose working set fits in memory, or whose time goes to CPU or locks, may see little change. Capture your read pattern with pg_stat_io before and after the change, so you can tell whether reads are the bottleneck.

Writes and checkpoints stay unchanged

Asynchronous I/O in PostgreSQL 18 targets reads. Write-ahead logging, checkpoints and background writes keep their current behavior, so a slow checkpoint or a WAL bottleneck will not improve by enabling it. Keep your checkpoint and WAL settings under review in the same test cycle, and do not read a write-heavy result as a verdict on asynchronous I/O.

Driver and application changes

Confirm that your drivers, connection poolers and application code need no changes for this setting. The setting is server-side, so most applications should not notice it, but client-side behavior around timeouts, prepared statements and pooling still matters during testing. Run your application's own test suite against the new setting, because the performance tests alone will not show a changed query result or error path.

How DeployOpen scopes and delivers PostgreSQL I/O tuning

DeployOpen approaches asynchronous I/O in PostgreSQL 18 as a measured change to a specific server, not a settings edit. We start from your current workload and hardware, agree the scope in writing, then build and test the io_method choice and worker limits against your own read-heavy queries before anything reaches production.

How we scope

  • Confirm your current PostgreSQL major version and whether an upgrade to 18 is already planned or approved.
  • Record the storage type, operating system and io_method candidates your platform team can support.
  • Define the read-heavy workloads, baseline measurements and before-and-after tests the written scope will cover.

How we build

  • Benchmark the current cluster and capture top read queries before changing io_method or io_workers.
  • Test sync, worker and io_uring settings on a staging copy, checking that the chosen io_method is available on your build.
  • Tune io_workers and related limits together with memory and connection settings, then rerun the same benchmark.

How we hand over

  • Deliver the final configuration, the reasons for each value and the benchmark results before and after the change.
  • Document the rollback path, including how to return to a previous io_method and restart the server safely.
  • Provide a runbook for repeating the benchmark after future minor releases, major upgrades or hardware changes.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer for teams that want review after each release.
  • Ask any quote to separate one-time tuning work from recurring retainer support and retesting effort.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.