📜 ⬆️ ⬇️

Linux I / O Scheduler. Choose the best

Want to read from the screw faster? It is time to pick up the I / O Scheduler.

What do we need to achieve the goal?
First, the installed hdparm:

  # aptitude install hdparm 


Secondly, a small script:
')
  # DISC = "sda";  \
  cat / sys / block / $ DISC / queue / scheduler;  \
  for T in noop anticipatory deadline cfq;  do \
      echo $ T> / sys / block / $ DISC / queue / scheduler;  \
      cat / sys / block / $ DISC / queue / scheduler;  \
      sync && / sbin / hdparm -tT / dev / $ DISC && echo "----";  \
      sleep 15;  \
  done 


If the disk is not sda, then appropriately correct the piece of code with the declaration:
  DISC = "sda"; 

Run and get a similar result:
  noop anticipatory deadline [cfq]
 [noop] anticipatory deadline cfq

 / dev / sda:
 Timing cached reads: 1690 MB in 2.00 seconds = 844.83 MB / sec
 Timing buffered disk reads: 216 MB in 3.00 seconds = 71.91 MB / sec
 ----
 noop [anticipatory] deadline cfq

 / dev / sda:
 Timing cached reads: 1612 MB in 2.00 seconds = 805.98 MB / sec
 Timing buffered disk reads: 208 MB in 3.03 seconds = 68.67 MB / sec
 ----
 noop anticipatory [deadline] cfq

 / dev / sda:
 Timing cached reads: 1644 MB in 2.00 seconds = 822.10 MB / sec
 Timing buffered disk reads: 206 MB in 3.02 seconds = 68.20 MB / sec
 ----
 noop anticipatory deadline [cfq]

 / dev / sda:
 Timing cached reads: 1728 MB in 2.00 seconds = 864.06 MB / sec
 Timing buffered disk reads: 214 MB in 3.01 seconds = 71.05 MB / sec
 ----

The first line is purely informational, in it we just see the scheduler that is currently in use and can always return to it.
Attention! The script goes through the sheduler when testing and does not restore the originally installed.
Then follow the testing section. The most optimal result is chosen manually; it corresponds to the highest reading speed of megabytes per second. In short, we are engaged in rounding :)
The new value can be set directly in grub by changing the value of elevator = ...
Further:
  # update-grub
 # reboot


Related Links:
www.redhat.com/magazine/008jun05/features/schedulers
www.redhat.com/promo/summit/2008/downloads/pdf/Thursday/Sanjay_Rao.pdf
sfdoccentral.symantec.com/sf/5.0/linux/html/sf_rac_install/sfrac_prep_install27.html

Source: https://habr.com/ru/post/81504/


All Articles