[MDEV-16260] Scale the purge effort according to the workload Created: 2018-05-23 Updated: 2024-01-18 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 4 |
| Labels: | performance, purge | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
| Comments |
| Comment by Marko Mäkelä [ 2019-05-17 ] | ||||||||||||||||||||||||||||||||
|
The first step should be to replace the purge threads with the common work queue that will be implemented in 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. | ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-11-15 ] | ||||||||||||||||||||||||||||||||
|
As noted in | ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-02-17 ] | ||||||||||||||||||||||||||||||||
|
It looks like we may have to reduce the scope of this task, so that something can be delivered in the 10.5 release. wlad mentioned that we could dynamically scale the number of purge workers to make a slow shutdown (innodb_fast_shutdown=0) faster. That would not require any interface changes and could thus be done even after a feature freeze. This is now filed as | ||||||||||||||||||||||||||||||||
| Comment by Rick James [ 2020-02-17 ] | ||||||||||||||||||||||||||||||||
|
I question whether "Measure the time to reach History list length 0" is the appropriate metric. I fear that minimizing that time will throw all CPU and I/O resources at the purge task while starving queries of such resources. | ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-02-17 ] | ||||||||||||||||||||||||||||||||
|
rjasdfiii, my note in the Description was only giving ideas for benchmarks. For dynamically tuning the system, we would have to use multiple metrics and parameters, such as innodb_io_capacity and innodb_io_capacity_max. | ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-06-03 ] | ||||||||||||||||||||||||||||||||
|
As highlighted in | ||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2020-06-04 ] | ||||||||||||||||||||||||||||||||
|
mariadb-sys-purge-shutdown2.svg attachment generated with: 1. sysbench --db-driver=mysql --mysql-host=192.168.10.4 --mysql-port=$port --threads=128 \ Server configuration: per
| ||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2020-06-04 ] | ||||||||||||||||||||||||||||||||
|
Notes from mariadb-sys-purge-shutdown2.svg (in no particular order)
fdatasync - 1.36% (from looking at raw perf)
| ||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2020-06-04 ] | ||||||||||||||||||||||||||||||||
|
mariadb-sys-purge-shutdown3.perf.txt | ||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2020-06-05 ] | ||||||||||||||||||||||||||||||||
|
disabling the double write buffer reduced shutdown time significantly 11 seconds below to 42 seconds previously. mariadb-sys-purge-shutdown-no-dblbfr.txt reflects this with less time spent in locks.
| ||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-01-25 ] | ||||||||||||||||||||||||||||||||
|
https://www.kernel.org/doc/html/latest/accounting/psi.html "Actually the I/O pressure could be something for controlling the rate of purging transaction history" (like | ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-02-03 ] | ||||||||||||||||||||||||||||||||
|
I wonder what remains to be done after | ||||||||||||||||||||||||||||||||
| Comment by Rick James [ 2022-02-04 ] | ||||||||||||||||||||||||||||||||
|
Will any new GLOBAL STATUS values be added to help users gain insight? Perhaps something like a "exponential moving average" of, say, the history_length. | ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-09-06 ] | ||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-10-13 ] | ||||||||||||||||||||||||||||||||
|
After |