Andres Freund: The path to using AIO in postgres (PGConf.EU 2023)

Discover the benefits of using Asynchronous I/O (AIO) in PostgreSQL, including improved performance, scalability, and practical applications in sequential scans, vacuuming, and crash recovery.

Key takeaways
  • Asynchronous I/O (AIO) in Postgres is beneficial, especially for large shared buffers.
  • Direct AIO is required for wall writes, as the operating system’s buffer management is not suitable.
  • AO in POSIX provides a standardized way to do asynchronous I/O.
  • Using AIO for sequential scans can lead to significant performance improvements.
  • Vacuuming and crash recovery can also benefit from AIO.
  • AO in PostgreSQL is a project that has been ongoing for a few years.
  • The developer has been working on it since 2015, and it’s mostly complete.
  • There are many benefits to using AIO, such as increased performance and scalability.
  • The biggest issue is that the operating system does not have a good implementation of AO.
  • Direct AIO can be much faster than buffered AIO, especially for sequential scans.
  • The developer is planning to add more features to PostgreSQL to support AIO.
  • There are no specific constraints or prerequisites to using AO in PostgreSQL, but developers should consider the size of shared buffers and the type of workload.
  • AO in PostgreSQL is currently mostly done using the streaming interface.
  • The developer has been working with several colleagues on this project, and it is mostly complete.
  • The main issues with AIO are the operating system’s buffer management and the limited write concurrency.
  • AO is planned to be used in many areas of PostgreSQL, including sequential scans, vacuuming, and crash recovery.
  • The developer is planning to add more features to support AO, such as relation extension and bulk modification.