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

Share your own howto's etc. Not for support questions!

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

Postby Head_on_a_Stick » 2017-02-26 12:13

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/Linux_Multi-Queue_Block_IO_Queueing_Mechanism_%28blk-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.
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6804
Joined: 2014-06-01 17:46
Location: /dev/chair

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

Postby acewiza » 2017-02-26 15:41

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
acewiza
 
Posts: 272
Joined: 2013-05-28 12:38
Location: Out West

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

Postby Head_on_a_Stick » 2017-02-26 16:00

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?
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6804
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable