Hasty Briefsbeta

Tuning async IO in PostgreSQL 18

8 hours ago
  • #Performance Tuning
  • #PostgreSQL
  • #AIO
  • PostgreSQL 18 introduces asynchronous I/O (AIO), improving I/O scheduling and storage utilization.
  • Key parameters for tuning AIO are `io_method` (options: sync, worker, io_uring) and `io_workers` (default: 3).
  • The default `io_method = worker` is recommended for most systems due to its asynchronous nature and broad platform support.
  • `io_uring` is efficient but Linux-specific and may have file descriptor limitations.
  • Increasing `io_workers` (e.g., to 25% of cores) can improve performance, especially on larger machines.
  • AIO has trade-offs: `worker` spreads I/O workload but uses signals for IPC, while `io_uring` avoids signals but may hit per-process bandwidth limits.
  • Future improvements may include adaptive I/O worker management based on demand.
  • For now, stick with `io_method = worker` and adjust `io_workers` based on core count.