• Vladislav Vaintroub's avatar
    MDEV-31095 tpool - restrict threadpool concurrency during bufferpool load · e33e2fa9
    Vladislav Vaintroub authored
    Add threadpool functionality to restrict concurrency during "batch"
    periods (where tasks are added in rapid succession).
    This will throttle thread creation more agressively than usual, while
    keeping performance at least on-par.
    
    One of these cases is bufferpool load, where async read IOs are executed
    without any throttling. There can be as much as 650K read IOs for
    loading 10GB buffer pool.
    
    Another one is recovery, where "fake read" IOs are executed.
    
    Why there are more threads than we expect?
    Worker threads are not be recognized as idle, until they return to the
    standby list, and to return to that list, they need to acquire
    mutex currently held in the submit_task(). In those cases, submit_task()
    has no worker to wake, and would create threads until default concurrency
    level (2*ncpus) is satisfied. Only after that throttling would happen.
    e33e2fa9
buf0dump.cc 19 KB