A PostgreSQL server has been restarted after a crash, and the team is considering io_uring because PostgreSQL 18.7 fixed a related resource leak.
Fast decision: keep the default worker method first. Test io_uring only on a build and system that support it, using representative workloads; switch only if repeatable results show a real benefit and rollback has been verified.
This runbook is for DBAs responsible for PostgreSQL 18 production databases who need to match the I/O method to query and maintenance patterns.
It is also for Linux and infrastructure engineers checking build support, system permissions, and restart behavior.
Database procurement leads can use it to determine whether dedicated CPU, memory, and NVMe resources fit their actual access patterns.
Last updated November 18, 2026. We checked the PostgreSQL 18.7 release notes and PostgreSQL 18 documentation for the settings and observation points described below.
Understand what PostgreSQL 18.7 changed
The PostgreSQL 18.7 release notes describe a resource leak that could occur when io_method was set to io_uring and the server crashed and restarted. The release notes do not say that PostgreSQL changed its default method, that every installation uses io_uring, or that this method improves every workload. The fix addresses a failure condition; it is not a performance recommendation. See the PostgreSQL 18.7 release notes.
PostgreSQL 18 documents three methods: worker, io_uring, and sync. The default is worker. io_uring requires the relevant build support, and io_method is set at server startup, so changing it requires a restart. Check the PostgreSQL 18 resource settings before editing a production configuration.
| Method | Appropriate role in a comparison | What to verify |
|---|---|---|
worker |
Default baseline and reasonable production choice when no measured case supports a change | The workload’s query paths, I/O activity, and resource pressure |
io_uring |
Candidate for controlled testing when the PostgreSQL build and runtime environment support it | Build capability, system-call access, restart behavior, and repeatable workload results |
sync |
Optional comparison point for controlled testing | Whether it helps isolate the effect of asynchronous I/O for the tested workload |
Treat the table as a test plan, not a ranking. A faster storage device does not by itself prove that switching methods will help. The deciding question is whether the workload issues reads on paths that can benefit, and whether I/O is limiting the workload in the first place.
Match the method to real database work
A query’s plan and runtime behavior matter more than its label. Start with the work that consumes time or interferes with service, then choose a test that reproduces that work. PostgreSQL’s EXPLAIN documentation explains how to inspect a plan; use ANALYZE only when running the query is safe in the test environment.
| Workload pattern | What to examine before testing | Initial decision |
|---|---|---|
| Large sequential reads or analytical scans | Whether the plan uses sequential or bitmap heap scans, and whether storage waits appear during the read | Include in a controlled comparison if it is representative and I/O-bound |
| VACUUM and ANALYZE work | Maintenance duration, I/O pressure, CPU use, and interference with application requests | Test maintenance separately from online traffic |
| Index-heavy, short-transaction OLTP | The actual plan, lock waits, cache behavior, and evidence of read I/O waits | Keep worker unless the I/O path is a demonstrated bottleneck |
| Mixed production traffic | How maintenance, analytical reads, and application requests overlap | Test a representative mix, not just a single isolated query |
Large scans are plausible candidates because they may involve substantial reads, but a scan can also be limited by CPU, cache state, query shape, or concurrency. Compare the same SQL and execution plan under equivalent data and cache conditions. Record query duration, CPU activity, storage I/O, and concurrent request behavior together. A single lower elapsed time is not enough to justify a production change.
VACUUM and ANALYZE have a different operational profile from application queries. Assess whether maintenance competes with online work for disk and CPU, rather than deciding from maintenance duration alone. The VACUUM command documentation describes maintenance behavior; run representative maintenance in a test environment or a controlled window, and observe application effects at the same time.
For index access and short transactions, verify the plan and wait profile before attributing a slowdown to storage. If the dominant constraint is lock contention, CPU saturation, or cache misses, changing the I/O method may not address the cause. Keep the default when testing fails to show stable improvement for the workload that actually matters.
Check the build and runtime before testing
Do not assume that a PostgreSQL server can use io_uring because the operating system or NVMe device supports it. PostgreSQL must be built with the necessary support, and the runtime environment must permit the required system calls. Containers, service restrictions, or security policy can prevent a candidate method from operating as expected. The PostgreSQL build documentation covers build options; record the build details alongside test results.
First inspect the running setting:
SHOW io_method;
Then check the build and deployment environment using the operating system and PostgreSQL installation records. If support is absent or the runtime blocks the required calls, do not weaken a security policy merely to force a test. Use worker as the baseline and record the constraint. A successful configuration change is not worth introducing an unreviewed security exception.
Because io_method is read at server startup, apply a candidate change in an isolated environment or an approved maintenance window. Validate service startup, application connectivity, and the ability to restore the original setting before treating the test as complete.
Use pg_aios and system observations together
PostgreSQL provides pg_aios and I/O statistics that can help explain what happened during a run. The pg_aios view documentation describes the view; the monitoring statistics documentation explains the broader statistics context. Read these alongside the query plan and operating-system observations. No single view establishes that a particular query benefited from io_uring.
Inspect the available view definitions and columns for the running release rather than copying an unfamiliar query into production. For example, in psql:
\d+ pg_aios
\d+ pg_stat_io
Capture observations before and during each test run, then compare equivalent windows. If the I/O statistics change but application latency does not improve, that is not a reason to switch. If query time improves but CPU cost or interference with concurrent traffic worsens, the trade-off may also be unacceptable.
For repeatable application-style load, use a workload that reflects the database’s real transaction mix. The pgbench documentation describes the tool and its test options. A generic benchmark is useful for controlled comparisons, but it cannot replace replaying representative queries and maintenance patterns.
FAQ: Defaults, suitability, and observation
Is io_uring enabled by default in PostgreSQL 18?
No. PostgreSQL 18 documents worker as the default io_method. io_uring is an option only when the PostgreSQL build includes the required support, and the method is selected at server startup. Check the running setting and build capabilities before planning a comparison. An NVMe device alone does not enable or require io_uring.
Does PostgreSQL 18.7 mean the setting should be changed?
No. The PostgreSQL 18.7 release notes describe a resource leak that could occur with io_method set to io_uring after a crash and restart. The fix does not change the default method or show that io_uring is faster for a given database. Keep worker unless controlled testing supports a change for the workload in question.
Which method suits an NVMe database: worker or io_uring?
The storage device does not determine which method is better. First confirm that the tested query follows an I/O path relevant to PostgreSQL’s asynchronous I/O and that storage is a real bottleneck. Compare both methods using equivalent data, plans, cache conditions, and concurrency. Keep worker if results are inconsistent or another resource is limiting performance.
How do we verify that a query uses asynchronous I/O?
Start with EXPLAIN (ANALYZE, BUFFERS) on a representative query to inspect its plan and buffer behavior. Compare pg_aios and PostgreSQL I/O statistics during the same run, together with operating-system storage and CPU observations. Interpret these signals as a set: a view entry alone does not prove that the query benefited from io_uring.
Run a controlled comparison with a rollback path
Use this sequence before changing a production setting:
- [ ] Choose a representative workload. Select the analytical read, maintenance task, or transaction mix that has a documented operational impact. Record the SQL or workload definition and the expected application behavior.
- [ ] Capture the baseline. Confirm the current
io_method, PostgreSQL build, operating environment, query plan, cache conditions, and relevant CPU and storage observations. Save the configuration so the baseline can be restored. - [ ] Verify prerequisites. Confirm build support and runtime permission for
io_uring. If either is missing, stop the candidate test and retainworker; do not treat a security-policy change as a routine prerequisite. - [ ] Compare equivalent runs. Test
workeragainstio_uringin isolation or a controlled window. Keep data, query plans, cache state, and concurrency as consistent as possible. Usesynconly if it helps answer a specific comparison question. - [ ] Observe more than elapsed time. Review query duration, CPU, storage I/O, and concurrent application behavior together. Use
pg_aios,pg_stat_io, and operating-system observations to explain results, not to declare a winner from one metric. - [ ] Test restart and rollback. Apply the candidate setting only in the controlled environment or approved window. Confirm that the server starts, the application reconnects, and restoring the previous setting returns the system to its baseline behavior.
- [ ] Verify recoverability. Confirm that a recent backup can be restored before making the change part of production operations. PostgreSQL documents continuous archiving and point-in-time recovery in its continuous archiving documentation.
Do not infer a general performance result from a community measurement or a one-off test. Community discussions and individual test reports can suggest what to investigate, but they are not evidence of how a different database, query mix, build, or storage layout will behave. We have no site-specific PostgreSQL io_uring benchmark to report here.
Make the production decision and plan storage safely
Switch only when the candidate method is supported, the test reproduces a meaningful workload, and results show a consistent benefit without unacceptable impact on concurrent work. Document the PostgreSQL version, build, setting, workload, query plan, cache conditions, observations, restart result, and rollback result. If any of those conditions is missing, leave worker in place and revisit the question when the workload or environment changes.
Do not confuse an I/O-method decision with a data-protection plan. A database server can still lose data through disk failure, operator error, or an unsuccessful recovery process. Plan software RAID or database replication where appropriate, and keep backups outside the database host. Verify restore procedures; a backup that has never been restored is not a proven recovery path.
If representative tests show that the database needs dedicated CPU, memory, or direct-attached NVMe, compare those requirements with the current mbpscloud product table and supported operating systems before choosing a deployment. Shared VPS or cloud instances may introduce noisy-neighbor contention, allocation limits, or storage tiers that are harder to align with a database’s I/O profile; dedicated hardware is not the right choice for every temporary or lightly loaded service, but it is worth evaluating when stable, sustained database resources are required. Review the server scenarios for fit, then check the available order options against the workload and recovery plan.
Frequently asked questions
Is io_uring enabled by default in PostgreSQL 18?
No. PostgreSQL 18 documents worker as the default io_method. io_uring is an available option only when the PostgreSQL build has the required support, and the method is selected at server startup. Check the running setting and build capabilities before planning a comparison; an NVMe device alone does not enable or require io_uring.
Does the PostgreSQL 18.7 fix mean I should change io_method?
No. The PostgreSQL 18.7 release notes describe a resource leak that could occur with io_method set to io_uring after a crash and restart. The fix does not change the default worker method and does not establish that io_uring is faster for a particular workload. Keep worker unless controlled testing supports a change.
Which is a better fit for NVMe: worker or io_uring?
Neither is universally better because the storage device does not determine whether a query uses an asynchronous I/O path or whether that path is the bottleneck. Compare both methods using the same query plan, data, cache conditions, and concurrency. Retain worker if the measured result is inconsistent or the workload is limited by locks, CPU, or cache misses.
How can I check whether a PostgreSQL query uses asynchronous I/O?
Start with EXPLAIN (ANALYZE, BUFFERS) on a representative query to identify its scan path and buffer behavior. Then compare pg_aios and PostgreSQL I/O statistics during the same controlled run, alongside operating-system storage and CPU observations. These signals need context; a view entry alone does not prove that the query benefited from io_uring.
Test PostgreSQL 18 on Dedicated AMD Bare Metal
Run a controlled I/O comparison on mbpscloud AMD EPYC 7543P servers with 32 cores and 64 threads dedicated to you.
