• Marko Mäkelä's avatar
    MDEV-26004 Excessive wait times in buf_LRU_get_free_block() · 60ed4797
    Marko Mäkelä authored
    buf_LRU_get_free_block(): Initially wait for a single block to be
    freed, signaled by buf_pool.done_free. Only if that fails and no
    LRU eviction flushing batch is already running, we initiate a
    flushing batch that should serve all threads that are currently
    waiting in buf_LRU_get_free_block().
    
    Note: In an extreme case, this may introduce a performance regression
    at larger numbers of connections. We observed this in sysbench
    oltp_update_index with 512MiB buffer pool, 4GiB of data on fast NVMe,
    and 1000 concurrent connections, on a 20-thread CPU. The contention point
    appears to be buf_pool.mutex, and the improvement would turn into a
    regression somewhere beyond 32 concurrent connections.
    
    On slower storage, such regression was not observed; instead, the
    throughput was improving and maximum latency was reduced.
    
    The excessive waits were pointed out by Vladislav Vaintroub.
    60ed4797
buf0lru.cc 42.5 KB