• Marko Mäkelä's avatar
    MDEV-24280 InnoDB triggers too many independent periodic tasks · 657fcdf4
    Marko Mäkelä authored
    A side effect of MDEV-16264 is that a large number of threads will
    be created at server startup, to be destroyed after a minute or two.
    
    One source of such thread creation is srv_start_periodic_timer().
    InnoDB is creating 3 periodic tasks: srv_master_callback (1Hz)
    srv_error_monitor_task (1Hz), and srv_monitor_task (0.2Hz).
    
    It appears that we can merge srv_error_monitor_task and srv_monitor_task
    and have them invoked 4 times per minute (every 15 seconds). This will
    affect our ability to enforce innodb_fatal_semaphore_wait_threshold and
    some computations around BUF_LRU_STAT_N_INTERVAL.
    
    We could remove srv_master_callback along with the DROP TABLE queue
    at some point of time in the future. We must keep it independent
    of the innodb_fatal_semaphore_wait_threshold detection, because
    the background DROP TABLE queue could get stuck due to dict_sys
    being locked by another thread. For now, srv_master_callback
    must be invoked once per second, so that
    innodb_flush_log_at_timeout=1 can work.
    
    BUF_LRU_STAT_N_INTERVAL: Reduce the precision and extend the time
    from 50*1 second to 4*15 seconds.
    
    srv_error_monitor_timer: Remove.
    
    MAX_MUTEX_NOWAIT: Increase from 20*1 second to 2*15 seconds.
    
    srv_refresh_innodb_monitor_stats(): Avoid a repeated call to time(NULL).
    Change the interval to less than 60 seconds.
    
    srv_monitor(): Renamed from srv_monitor_task.
    
    srv_monitor_task(): Renamed from srv_error_monitor_task().
    Invoked only once in 15 seconds. Invoke also srv_monitor().
    Increase the fatal_cnt threshold from 10*1 second to 1*15 seconds.
    
    sync_array_print_long_waits_low(): Invoke time(NULL) only once.
    Remove a bogus message about printouts for 30 seconds. Those
    printouts were effectively already disabled in MDEV-16264
    (commit 5e62b6a5).
    657fcdf4
srv0start.cc 59.2 KB