惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
S
Schneier on Security
博客园 - 三生石上(FineUI控件)
P
Proofpoint News Feed
G
Google Developers Blog
Project Zero
Project Zero
小众软件
小众软件
NISL@THU
NISL@THU
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
Vulnerabilities – Threatpost
B
Blog RSS Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
宝玉的分享
宝玉的分享
博客园 - 司徒正美
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
G
GRAHAM CLULEY
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Cisco Talos Blog
Cisco Talos Blog
C
Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
T
Tailwind CSS Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
PCI Perspectives
PCI Perspectives
S
Security @ Cisco Blogs
Google Online Security Blog
Google Online Security Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
B
Blog
The Hacker News
The Hacker News
Attack and Defense Labs
Attack and Defense Labs
腾讯CDC
T
Tenable Blog
酷 壳 – CoolShell
酷 壳 – CoolShell

Tomas Vondra

Some more thoughts on random_page_cost How are committers selected? The real cost of random I/O The AI inversion Stabilizing Benchmarks Don't give Postgres too much memory (even on busy systems) Qubes OS is pretty great Wireguard to access a home network Don't give Postgres too much memory Tuning AIO in PostgreSQL 18 Using JWT to establish a trusted context for RLS Fun and weirdness with SSDs So why don't we pick the optimal query plan? How often is the query plan optimal? Benchmarking is hard, sometimes ... Advanced Patch Feedback Session (APFS) at pgconf.dev 2025 [PATCH IDEA] adaptive execution for `IN` queries 15 years of Prague PostgreSQL Developer Day Performance archaeology: OLAP Performance archaeology: OLTP Tuning the glibc memory allocator (for Postgres) [PATCH IDEA] parallel pgbench -i Playing with BOLT and Postgres [PATCH IDEA] amcheck support for BRIN indexes Writing a good talk proposal [PATCH IDEA] Statistics for the file descriptor cache Office hours experiment [PATCH IDEA] Using COPY for postgres_fdw INSERT batching Importing Postgres mailing list archives How to pick the first patch? Will Postgres development rely on mailing lists forever? The state of the Postgres community
Good time to test io_method (for Postgres 18)
2025-05-12 · via Tomas Vondra

We’re now in the “feature freeze” phase of Postgres 18 development. That means no new features will get in - only bugfixes and cleanups of already committed changes. The goal is to test and stabilize the code before a release. PG 18 beta1 was released a couple days ago, so it’s a perfect time to do some testing and benchmarking.

One of the fundamental changes in PG 18 is going to be support for asynchronous I/O. And with beta1 out, it’s the right time to run your tests and benchmarks to test this new feature. Both for correctness and regression.

Until now Postgres did only synchronous file I/O, using the traditional API read(), write() and a couple variants. A couple places also did explicit prefetching by calling posix_fadvise, but I wouldn’t count that as proper async I/O. For a long time this worked well enough, but we’ve been hitting more and more limitations of synchronous I/O.

Lukas Fittl published a really nice introduction, explaining the basics of how it works, why, how to collect and interpret stats, and so on. It’s a really nice explanation, clearer than I could write - and now I don’t have to. Go read it.

I’m not sure I’d describe async I/O as a performance improvement, but the other goals are more about development and internals, so users will probably see it that way.

It however also brings some new configuration options:

  • io_method - How is the async I/O actually handled?

  • io_workers - Number of I/O workers for io_method = worker.

The question is what should be the defaults for these parameters, and we need some help with that.

The io_method has three possible values:

  • sync - Regular sync I/O with prefetching using fadvise, and each backend is performing its I/O. This is the “backwards compatibility” choice, it’s as close to PG17 as possible.

  • worker - There’s a pool of I/O workers performing the I/O. Backends queue requests, workers handle them and notify the backends. The number of workers is set by io_workers, by default 3.

  • io_uring - Uses liburing to pass I/O requests to the kernel io_uring interface. This is the most modern option, but also optional (requires --with-liburing).

There is no “correct” default value. Each option has its pros and cons, and may work depending on the hardware, workload, etc. For now the default is worker with 3 workers, but that’s temporary. We wanted to test with the “properly” asynchronous methods, and the io_uring is optional (and not available on some platforms).

We’ll need to pick the actual default in a couple months, perhaps in July or so.

And this is where you can help! Do you have some sort of test suite for your application (running on Postgres)? Even better if you have some benchmarks with I/O intensive queries, or less common hardware.

Please try running that on PG 18 with different io_method and io_workers values, and let us know. Did it work? Was it faster or slower?

Perhaps you have other arguments for picking a particular default value? For example, worker has the benefit that the worker processes are not responsible just for the I/O, but also for tasks like checksum verification. Which PG 18 enables by default for new clusters, and the verification costs a bit of CPU time.

Conclusions

Help us with stabilizing PG 18, and with figuring out the defaults for io_method and io_worker. Install the beta1, and run as many tests and benchmarks as possible. Ideally, you’d have some application specific test/benchmark. Now is a great time to run it on PG 18 beta1, and report the interesting results to pgsql-hackers.

Do you have feedback on this post? Please reach out by e-mail to tomas@vondra.me.