• inaam's avatar
    branches/zip rb://133 · 6e6d1e86
    inaam authored
    This patch introduces heuristics based flushing rate of dirty pages to
    avoid IO bursts at checkpoint.
    
    1) log_capacity / log_generated per second gives us number of seconds
    in which ALL dirty pages need to be flushed. Based on this rough
    assumption we can say that
    n_dirty_pages / (log_capacity / log_generation_rate) = desired_flush_rate
    
    2) We use weighted averages (hard coded to 20 seconds) of
    log_generation_rate to avoid resonance.
    
    3) From the desired_flush_rate we subtract the number of pages that have
    been flushed due to LRU flushing. That gives us pages that we should
    flush as part of flush_list cleanup. And that is the number (capped by
    maximum io_capacity) that we try to flush from the master thread.
    
    Knobs:
    ======
    
    innodb_adaptive_flushing: boolean, global, dynamic, default TRUE.
    Since this heuristic is very experimental and has the potential to
    dramatically change the IO pattern I think it is a good idea to leave a
    knob to turn it off.
    
    Approved by: Heikki
    
    6e6d1e86
ha_innodb.cc 287 KB