Bug #75512 | buf_flush_do_batch can be optimized if the lsn_limit is already satisfied. | ||
---|---|---|---|
Submitted: | 15 Jan 2015 7:59 | Modified: | 10 Mar 2015 3:20 |
Reporter: | zhai weixiang (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.7.5, 5.7.6 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[15 Jan 2015 7:59]
zhai weixiang
[15 Jan 2015 8:02]
zhai weixiang
Since all sessions need to wait all batch flush end in function log_preflush_pool_modified_pages, I think this change should be safe.
[15 Jan 2015 8:07]
zhai weixiang
a simple patch for discuess, not tested fully
Attachment: bug75512.diff (application/octet-stream, text), 5.99 KiB.
[20 Jan 2015 20:53]
Sveta Smirnova
Thank you for the report. Verified as described using code analysis. But regardless of the state of the bug could you, please, provide example scenario when current behavior leads to significant performance loss (if I understood correctly returned false leads to one more iteration in buf_flush_lists) or wrong behavior.
[21 Jan 2015 1:53]
zhai weixiang
If the LSN age increased quickly and exceeded max_modified_age_sync, the user threads began to preflush dirty pages. Thi scenario can benefit from the changes. To repeat: Under heavy DML workload, with relaxed setting (for example : sync_binlog = 0, innodb_flush_log_at_trx_commit =2, gtid_mode=off ), also reduce the total size of redo log file. I've tested the changes on our production environment. The improvement is not very obvious. Anyway, better than nothing. :-)
[10 Mar 2015 3:20]
zhai weixiang
should this bug be closed because of some new changes in 5.7.6 ? In 5.7.6, the user threads doesn't need to do page flushes. Instead, it will only wait for the page cleaner thread. quoted change log entry : When the oldest modification LSN is close to the defined maximum (max_modified_age_sync), a synchronous preflush of buffer pool pages is initiated which may result in a “flush wait” scenario for user threads. To smooth throughput, user threads are only required to wait for a target LSN to be reached instead of waiting for an entire flushing batch to finish.