A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android

Image
I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...

PostgreSQL 18 Async I/O: Measure It Before You Tune It

PostgreSQL 18 Async I/O: Measure It Before You Tune It

PostgreSQL 18 adds a substantial change beneath familiar SQL: an asynchronous I/O subsystem. Instead of making every eligible read wait for completion before requesting the next one, PostgreSQL can keep multiple storage requests in flight. The project reports up to 3x improvement in some storage-read scenarios.

That headline is useful, but it is not a tuning promise. The benefit depends on the operations your workload performs, the latency and throughput of its storage, the amount of concurrency, and the PostgreSQL build and operating system. The right lesson is not “turn on io_uring.” It is “benchmark the I/O path that your workload actually uses.”

What changed in PostgreSQL 18

PostgreSQL 18 can use asynchronous I/O for operations including sequential scans, bitmap heap scans, and vacuum. The new io_method setting selects how asynchronous-eligible I/O is executed:

  • worker uses PostgreSQL worker processes and is the default.
  • io_uring uses Linux's io_uring interface when PostgreSQL was built with liburing support.
  • sync executes asynchronous-eligible I/O synchronously, preserving behavior close to older releases.

The setting is a server-start parameter, so changing it requires a restart. io_workers controls the number of I/O workers when io_method is worker. Other settings, such as effective_io_concurrency and io_max_concurrency, influence how much I/O can be issued concurrently. These are capacity controls, not guaranteed performance multipliers.

Why the fastest option is not universal

Asynchronous I/O helps when a query is waiting on storage and PostgreSQL can overlap useful requests. It cannot remove a CPU bottleneck, make slow storage fast, or improve every access path. A point lookup dominated by an index scan may behave differently from a large sequential scan. A workload that fits in memory may have little storage to overlap at all.

Independent testing by PlanetScale illustrates the tradeoff. In its read-only tests over a roughly 300 GB dataset, PostgreSQL 18's worker and sync modes often beat io_uring on some network-attached-storage configurations. io_uring was more competitive in other high-concurrency or local-NVMe cases. Those results are not a contradiction: they show that device latency, I/O concurrency, query shape, and CPU work all affect the result.

Do not copy a benchmark's winner into production. Use it to form a hypothesis about what to measure.

A safe benchmark plan

  1. Describe the production shape. Record PostgreSQL version, operating system, CPU and memory, storage type, filesystem, dataset size, cache state, connection concurrency, and the query mix. A benchmark that fits in RAM answers a different question from one that repeatedly reads from storage.
  2. Choose representative operations. Include the slow read-heavy queries and maintenance jobs you hope to improve. Capture plans with EXPLAIN (ANALYZE, BUFFERS), but remember that a single plan is not a workload benchmark.
  3. Compare a small matrix. On an isolated staging copy, compare PostgreSQL 18 with io_method=sync, worker, and, where supported, io_uring. Keep data, PostgreSQL settings, storage, and client workload fixed. Run enough repetitions to account for cache and background activity.
  4. Measure more than average throughput. Record latency percentiles, transactions or queries per second, CPU utilization, storage latency, IOPS, throughput, queue depth, and vacuum duration. A higher average can still be a regression if tail latency or resource contention increases.
  5. Test warm and cold-enough conditions. Document whether the dataset is already cached. If production is mixed, test both cache-friendly and storage-bound cases rather than presenting one number as the truth.
-- Check the active I/O-related settings SHOW io_method; SHOW io_workers; SHOW effective_io_concurrency; SHOW io_max_concurrency; -- Capture a representative read plan EXPLAIN (ANALYZE, BUFFERS, SETTINGS) SELECT customer_id, created_at, total FROM orders WHERE created_at >= current_date - interval '30 days';

Run the workload from a repeatable harness rather than timing one query manually. Keep the benchmark data private and representative, and do not benchmark production by changing restart-required settings during peak traffic.

What to tune—and what not to assume

Start with the default worker mode and establish a baseline. If the workload is storage-bound, compare alternatives under the same load. On Linux, io_uring requires a PostgreSQL build with liburing support; its availability alone is not evidence that it will win.

Change one meaningful variable at a time. Raising concurrency can increase throughput while also increasing queueing and tail latency. Raising io_workers can consume more worker capacity. Raising effective_io_concurrency too far can increase latency for the whole system. Treat these settings as a coordinated resource budget alongside max_connections, parallel workers, autovacuum, and the storage service's IOPS limit.

Use PostgreSQL's existing statistics views and operating-system storage metrics to explain a result. The pg_stat_io view helps examine PostgreSQL I/O activity, while track_io_timing can add timing information when its overhead is acceptable. A result without an explanation is difficult to trust and even harder to operate.

Upgrade advice

PostgreSQL 18 requires a major-version migration using pg_upgrade, dump and restore, or logical replication; it is not an in-place minor-version setting change. Plan the upgrade separately from I/O tuning. First establish that the upgraded cluster is healthy and that plans, statistics, extensions, backups, and monitoring are correct. Then test I/O modes with a controlled workload.

PostgreSQL 18 can retain optimizer statistics through pg_upgrade, which can reduce the period of poor plans immediately after an upgrade. That does not eliminate the need to validate plans and run normal maintenance. It simply makes the upgrade's performance behavior easier to manage.

The practical conclusion

PostgreSQL 18's asynchronous I/O is an important foundation, not a single switch that makes every database faster. The default worker mode is a reasonable starting point; io_uring is worth testing where it is supported; and sync remains a useful control case.

Make the change only when your measurements show a meaningful improvement for your workload, and keep the baseline, test conditions, and rollback plan. Database performance is a property of the query, data, cache, CPU, storage, and concurrency together—not of one configuration name.

References

❤️ Support This Blog


If this post helped you, you can support my writing with a small donation. Thank you for reading.


Comments

Popular Posts

How to SSH into an Oracle Cloud VPS from Android Using Termux and Cloudflare Tunnel

react-native run-android : do not build/update modified code(App.js)