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
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
NRE Projects | RM_105_CANDIDATE |
Priority | Major [ 3 ] | Critical [ 2 ] |
Link |
This issue is blocked by |
Assignee | Marko Mäkelä [ marko ] | Eugene Kosov [ kevg ] |
Link | This issue relates to MENT-599 [ MENT-599 ] |
Assignee | Eugene Kosov [ kevg ] | Vladislav Vaintroub [ wlad ] |
Link |
This issue relates to |
Fix Version/s | 10.5 [ 23123 ] | |
Assignee | Vladislav Vaintroub [ wlad ] | Eugene Kosov [ kevg ] |
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. h2. 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.) |
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. h2. 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. |
Priority | Critical [ 2 ] | Major [ 3 ] |
Link |
This issue relates to |
Attachment | mariadb-sys-purge-shutdown2.svg [ 52082 ] |
Attachment | mariadb-sys-purge-shutdown2.perf.txt [ 52083 ] |
Attachment | mariadb-sys-purge-shutdown3.perf.txt [ 52084 ] |
Attachment | mariadb-sys-purge-shutdown3.svg [ 52085 ] |
Attachment | mariadb-sys-purge-shutdown-no-dblbfr.txt [ 52089 ] |
Link | This issue relates to MDEV-22718 [ MDEV-22718 ] |
Link |
This issue relates to |
Link |
This issue relates to |
Workflow | MariaDB v3 [ 87405 ] | MariaDB v4 [ 130831 ] |
Assignee | Eugene Kosov [ kevg ] | Marko Mäkelä [ marko ] |
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. h2. 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. |
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. h2. 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. |
Link |
This issue is blocked by |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue is blocked by |
Issue Type | Task [ 3 ] | New Feature [ 2 ] |
Zendesk Related Tickets | 201658 | |
Zendesk active tickets | 201658 |
The first step should be to replace the purge threads with the common work queue that will be implemented in
MDEV-16264. After that, it should become meaningful to measure purge performance and the meaningfulness of the parameters.Apart from removing or revising innodb_max_purge_lag, we should also consider if it makes sense to have the parameter innodb_purge_batch_size. At the very least, all parameters related to purge should be settable at runtime.