[SSD] boost I/O performance with blk-mq

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

[SSD] boost I/O performance with blk-mq

#1 Post by Head_on_a_Stick »

Theory

The Linux kernel's traditional handling of I/O requests (scheduling) presents a bottleneck for modern solid state storage devices because the design is predicted on a single request queue which becomes quickly saturated by modern drives.

As an alternative to the usual I/O schedulers (noop, deadline, cfq & bfq), the Linux Multi-Queue Block I/O Queueing Mechanism can be employed instead:

https://www.thomas-krenn.com/en/wiki/Li ... 8blk-mq%29

This splits any I/O requests into separate submission queues (allocated across all CPUs) and hardware dispatch queues that buffer requests directly from the driver; the parallelisation greatly increases overall I/O capability.

Better explanation here:

https://lwn.net/Articles/552904/

Method

Edit the file at /etc/default/grub (as root!) and change the GRUB_CMDLINE_LINUX line — add the two parameters between the quotation marks, like this:

Code: Select all

GRUB_CMDLINE_LINUX="scsi_mod.use_blk_mq=y dm_mod.use_blk_mq=y"
Then save the file and update the GRUB configuration with:

Code: Select all

# grub-mkconfig -o /boot/grub/grub.cfg
Now reboot and check that no schedulers are being used for the drive:

Code: Select all

Helium: ~ $ cat /sys/class/block/sda/queue/scheduler 
none
This method should only be used on solid state drives, spinning rust devices will not benefit.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

User avatar
acewiza
Posts: 358
Joined: 2013-05-28 12:38
Location: Out West

Re: [SSD] boost I/O performance with blk-mq

#2 Post by acewiza »

Any benchmark comparison numbers or seat-o-the-pants impressions?
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: [SSD] boost I/O performance with blk-mq

#3 Post by Head_on_a_Stick »

No.

I have switched to this method because the paradigm is clearly superior, any actual performance gains or losses are immaterial and inconsequential for me.

Why not try some benchmarks and post them here?
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

Post Reply