Incorrect Maximum I/O Sector Size for Storage Device
This document (000021427) is provided subject to the disclaimer at the end of this document.
Environment
Situation
There are some storage devices that advertise a maximum block size which is not optimal for sustained performance.
Optimal maximum block size for sustained performance recommendation can be obtained from storage vendor.
The current value could be verified by:
# cat /sys/block/sda/queue/max_sectors_kb 64
* replace the device (sda) with the correct device. For NVMe devices the equivalent device-naming nvme0n1.
Resolution
Example: Settings max IO size to 16kB for device /dev/sda :
-
Temporary settings may be changed instantly with:
echo <value> > /sys/block/sdX/queue/max_sectors_kb
# echo 16 > /sys/block/sda/queue/max_sectors_kb
-
Permanent changes surviving across reboots can be done by udev rules:
Create a udev-rule file in /etc/udev/rules.d/ directory :
# vi /etc/udev/rules.d/77-persistent-max_sectors_kb.rules ACTION=="add|change", SUBSYSTEM=="block", ATTR{queue/max_sectors_kb}="16"
NOTE: The above udev rule limits I/O size to 16kB (max_sectors_kb) for all block devices. It may be required to adjust the rule according to specific needs.
If the changes need to be applied immediately, the udev rule might be enforced by:# udevadm control --reload && udevadm trigger
And verify the settings:
# grep -H '' /sys/block/*/queue/max_sectors_kb
Status
Additional Information
https://www.kernel.org/doc/html/v5.14/block/queue-sysfs.html#max-sectors-kb-rw
Documentation related to the UDEV rules:
https://documentation.suse.com/sles/15-SP5/html/SLES-all/cha-udev.html
NOTE: can also be configured as MPIO parameter at multipath level. Details can be found at the link below:
https://documentation.suse.com/sles/15-SP5/html/SLES-all/cha-multipath.html#sec-multipath-conf-misc
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021427
- Creation Date: 12-Apr-2024
- Modified Date:15-May-2024
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com