Re: Should io_method=worker remain the default?
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Jeff Davis <pgsql@j-davis.com>, pgsql-hackers@postgresql.org
Date: 2025-09-03T16:05:13Z
Lists: pgsql-hackers
Hi, On 2025-09-03 17:53:55 +0200, Álvaro Herrera wrote: > On 2025-Sep-02, Jeff Davis wrote: > > > The good news is that io_uring seemed to solve the problem. > > Unfortunately, that's platform-specific, so it can't be the default. > > Why not? We have had wal_sync_method with a platform-dependent default > for a very long time. At least for now there are other reasons: 1) io_uring needs a higher ulimit -n, because we need to create an io_uring instance for each proc entry, in postmaster. In the future, we might want to increase soft ulimit -n, but we aren't doing that yet. In older kernels the number of io_uring memory mapping also can pose a performance issue at high connection rates. 2) Sometimes worker is faster than io_uring, specifically when checksums are enabled. Workers can offload the checksum computations, io_uring can't. 3) We can't, at build time, know whether io_uring is actually available at runtime. io_uring can be disabled with a runtime sysctl. We could add a dynamic fallback to worker, but we don't have that yet. Anyway, the issue with worker in this case isn't inherent, it's just a bit of lock contention in an extreme workload... Greetings, Andres Freund
Commits
-
meson: Build numeric.c with -ftree-vectorize.
- 9016fa7e3bcd 19 (unreleased) landed
- 87ea6e9b66b6 18.0 landed
- 509c779293f2 16.11 landed
- 15f9eeef624f 17.7 landed
-
meson: build checksums with extra optimization flags.
- 2de24ca6ca51 16.11 landed
- e25453a3631f 17.7 landed
- a7024398b80a 18.0 landed
- 9af672bcb245 19 (unreleased) landed