| From: | Rajarshi Chowdhury <mailtorajarshi(at)gmail(dot)com> |
|---|---|
| To: | pgsql-performance(at)lists(dot)postgresql(dot)org |
| Subject: | Traced PostgreSQL 18's io_uring with eBPF |
| Date: | 2026-08-29 20:15:41 |
| Message-ID: | CACj4BHcXW0i7tOfDBghnP11Ez3L9dnY0UnMs-yzSEt4e+L7g-w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
PostgreSQL 18 ships three async I/O modes via io_method, and the default is
worker, not io_uring. On my cold seq scan benchmark io_uring was the
fastest of the three: 1.60s vs 1.88s for worker and 2.65s for sync.
Measured on a VM, so treat the ratio as the finding, not the absolute
numbers.
Enabling it is one setting plus a restart:
sudo -u postgres psql -c "ALTER SYSTEM SET io_method = 'io_uring'"
sudo pg_ctlcluster 18 main restart
sudo -u postgres psql -tAc 'SHOW io_method' # must print io_uring
After enabling, you can watch it actually work. I wrote an eBPF tool
(uringscope) that attaches to the kernel's io_uring tracepoints and shows
what Postgres submitted, per-request latency, and how many reads detoured
through kernel worker threads:
curl -LO
https://github.com/rch0wdhury/uringscope/releases/latest/download/uringscope-$(uname
-m)
chmod +x uringscope-$(uname -m) && sudo mv uringscope-$(uname -m)
/usr/local/bin/uringscope
sudo uringscope -a -d 20 # then run a seq scan in another session
Check https://github.com/rch0wdhury/uringscope
Disclosure: I'm the author of the tool.
--------------
Rajarshi
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Yonnys Mirabal | 2026-10-30 18:12:04 | PostgreSQL 18 — High write latency under concurrent load, .NET 10 / Npgsql |
| Previous Message | Pavel Stehule | 2026-07-30 14:10:43 | Re: pg_stat_statement not collecting information about queries inside functions. |