postgres-github.git / summary / log / commit / refs

commit    d1c01b79d4ae90e52bf9db9c05c9de17b7313e85
Author:   Thomas Munro <tmunro@postgresql.org>
Date:     Wed Apr 08 07:06:14 2026 +0000

    aio: Adjust I/O worker pool automatically.
    
    The size of the I/O worker pool used to implement io_method=worker was
    previously controlled by the io_workers setting, defaulting to 3.  It
    was hard to know how to tune it effectively.  That is replaced with:
    
      io_min_workers=2
      io_max_workers=8 (up to 32)
      io_worker_idle_timeout=60s
      io_worker_launch_interval=100ms
    
    The pool is automatically sized within the configured range according to
    recent variation in demand.  It grows when existing workers detect that
    latency might be introduced by queuing, and shrinks when the
    highest-numbered worker is idle for too long.  Work was already
    concentrated into low-numbered workers in anticipation of this logic.
    
    The logic for waking extra workers now also tries to measure and reduce
    the number of spurious wakeups, though they are not entirely eliminated.
    
    Reviewed-by: Andres Freund <andres@anarazel.de>
    Reviewed-by: Dmitry Dolgov <9erthalion6@gmail.com>
    Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
    Discussion: https://postgr.es/m/CA%2BhUKG%2Bm4xV0LMoH2c%3DoRAdEXuCnh%2BtGBTWa7uFeFMGgTLAw%2BQ%40mail.gmail.com

[parent: 948ef7cdc499]