Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
InnoDB in MySQL 5.6 (and MariaDB 10.0) introduced multiple inodb_purge_threads (4 by default).
When there are few modifications that require purging, the purge threads will either be mostly sitting idle, or they will form ‘thundering herds’ whenever some work turns up. In such a scenario, it would be better to have only one purge worker.
With this work, the poorly working parameter innodb_max_purge_lag should be revised or removed as well. The logic behind that parameter does not take into account the actual number of purgeable records; committed modifications cannot be purged while old read views exist that can access the old data.
Benchmarking is the key
This work must involve creating a benchmark to measure purge performance under various conditions:
- Ensure that everything has been purged (history list length is 0).
- Block purge by issuing START TRANSACTION WITH CONSISTENT SNAPSHOT from a new connection.
- From other connections, perform modifications that create workload for purge. Try different variations: tables with many indexes, many small transactions on many tables, large transactions on a single table.
- Commit or disconnect the connection that blocked purge.
- Measure the time to reach History list length 0 in SHOW ENGINE INNODB STATUS. (Some workaround for the batching logic related to innodb_purge_rseg_truncate_frequency may be needed.)
- Alternatively, measure the time to shutdown with innodb_fast_shutdown=0. But be sure to separate the impact of innodb_change_buffering. (Slow shutdown runs both purge and change buffer merge to completion.)
- We might also want to run with innodb_force_recovery=2 to disable the purge altogether, and then restart without that parameter and initiate a slow shutdown, to measure how long it takes to process all the undo log that was accumulated.
Attachments
Issue Links
- is blocked by
-
MDEV-16264 Implement a common work queue for InnoDB background tasks
- Closed
-
MDEV-29401 InnoDB history list length increased in 10.6 compared to 10.5 for the same load
- Closed
-
MDEV-32050 UNDO logs still growing for write-intensive workloads
- Closed
- relates to
-
MDEV-11802 innodb.innodb_bug14676111 fails in buildbot due to InnoDB purge failing to start when there is work to do
- Closed
-
MDEV-21751 innodb_fast_shutdown=0 can be unnecessarily slow
- Closed
-
MDEV-22577 innodb_fast_shutdown=0 fails to report purge progress
- Closed
-
MDEV-26356 Performance regression after dict_sys.mutex removal
- Closed
-
MDEV-26520 Make innodb_purge_threads settable without server restart
- Closed
-
MDEV-17745 innodb.innodb_stats_persistent failed in buildbot with wrong result
- Closed
-
MDEV-22718 InnoDB: purge_sys.low_limit_no() is not protected
- Stalled
-
MDEV-24258 Merge dict_sys.mutex into dict_sys.latch
- Closed