[MDEV-17380] innodb_flush_neighbors=ON should be ignored on SSD Created: 2018-10-05 Updated: 2023-06-01 Resolved: 2019-04-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | None |
| Fix Version/s: | 10.4.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | defaults, performance | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Description |
|
innodb_flush_neighbors was an optimization for rotating disk, to have larger IO size. It costs CPU, and it does not bring anything for the SSD. I think OFF is now a good default (and also it has good in the past couple of years) See for example |
| Comments |
| Comment by Vladislav Vaintroub [ 2018-11-22 ] | ||||||||||||||||||
|
Based on test benchmark, this might need some more investigation, on HDD it seems to bring a good improvement. sysbench 0.4 parameters (update_index)
relevant config settings
Results for 24 users, in TPS, for the above run shows about 2x increase in throughput for HDD HDD
| ||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-11-23 ] | ||||||||||||||||||
|
On Linux since kernel version 2.6.29, the type of the medium can be detected by querying a file like /sys/block/sda/queue/rotational. We could introduce a flag fil_space_t::is_rotational, and only allow innodb_flush_neighbors=ON to take effect on files that reside on rotational media. The same flag could also be used in | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-03-29 ] | ||||||||||||||||||
|
axel, I hope that you can test bb-10.4-marko on Linux. On HDD, the setting innodb_flush_neighbors (default ON) should continue to have a similar impact that wlad reported above. On my Linux system, /sys/block listed only nvme0n1. I additionally tested after plugging in USB devices. Both were reported as /sys/block/sd*/queue/rotational=1 even though only one of them is a hard disk, and the other is a memory card reader. I have earlier tested that a SATA SSD was reported as non-rotational. | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-09-01 ] | ||||||||||||||||||
|
Quoting the commit message:
In I just realized that ralf.gebhardt@mariadb.com and serg, perhaps we would like to retain INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES even if we remove the system table in 10.6? We could include a column ON_SSD there already starting with 10.4, to allow smooth upgrades to 10.5 and later versions. Currently we basically have a regression in 10.5 that removed the ON_SSD attribute. | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-09-23 ] | ||||||||||||||||||
|
I think that we could export the ON_SSD attribute as part of MDEV-20400, in a new view INFORMATION_SCHEMA.INNODB_TABLES or similar that contains one row per table (or partition or subpartition). A possible alternative might be to revive INFORMATION_SCHEMA.FILES, which was originally implemented for NDB, implemented in MySQL 5.7 for InnoDB’s CREATE TABLESPACE support, and reverted from MariaDB in | ||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-09-23 ] | ||||||||||||||||||
|
An even more natural alternative could be to extend the |