IO Scheduler: Difference between revisions

From Proxmox VE
Jump to navigation Jump to search
(page created)
 
m (changed default scheduling sentence)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Introduction =
== Introduction ==


The Linux kernel, the core of the operating system, is responsible for controlling disk access by using kernel IO scheduling.  
The Linux kernel, the core of the operating system, is responsible for controlling disk access by using kernel IO scheduling.  
Line 5: Line 5:
This article explains how-to change the IO scheduler without recompiling the kernel and without restart.
This article explains how-to change the IO scheduler without recompiling the kernel and without restart.


= Check the currently used IO scheduler =
== Check the currently used IO scheduler ==


  cat /sys/block/sda/queue/scheduler
  cat /sys/block/sda/queue/scheduler
Line 11: Line 11:
  noop anticipatory [deadline] cfq
  noop anticipatory [deadline] cfq


Proxmox VE uses deadline by default, delivers best performance on hardware raid and SAN environments.
For example the scheduler '''deadline''' delivers best performance on hardware raid and SAN environments. While '''noop''' delivers better performance for SSDs.


= Switching IO Schedulers on runtime =
== Switching IO Schedulers on runtime ==


Set the scheduler for /dev/sda to Deadline:  
Set the scheduler for /dev/sda to Deadline:  
Line 23: Line 23:
  echo cfq > /sys/block/sda/queue/scheduler
  echo cfq > /sys/block/sda/queue/scheduler


= Set IO Schedulers permanently =
== Set IO Schedulers permanently ==


In order to choose a new default scheduler you need to add the following into your /etc/default/grub:  
In order to choose a new default scheduler you need to add the following into your /etc/default/grub:  
Line 29: Line 29:
  nano /etc/default/grub
  nano /etc/default/grub


  GRUB_CMDLINE_LINUX="elevator=deadline"
  GRUB_CMDLINE_LINUX_DEFAULT="... elevator=deadline"


or:  
or:  


  GRUB_CMDLINE_LINUX="elevator=cfq"
  GRUB_CMDLINE_LINUX_DEFAULT="... elevator=cfq"


After you change /etc/default/grub you need to run update-grub to apply changes:
After you change /etc/default/grub you need to run update-grub to apply changes:
Line 39: Line 39:
  update-grub
  update-grub


= Links =
== Links ==
*http://en.wikipedia.org/wiki/Deadline_scheduler
*http://en.wikipedia.org/wiki/Deadline_scheduler
*http://en.wikipedia.org/wiki/CFQ
*http://en.wikipedia.org/wiki/CFQ
*https://cromwell-intl.com/open-source/performance-tuning/disks.html


[[Category: HOWTO]][[Category: Installation]]
[[Category: HOWTO]] [[Category:System Administration]]

Latest revision as of 07:38, 11 January 2019

Introduction

The Linux kernel, the core of the operating system, is responsible for controlling disk access by using kernel IO scheduling.

This article explains how-to change the IO scheduler without recompiling the kernel and without restart.

Check the currently used IO scheduler

cat /sys/block/sda/queue/scheduler
noop anticipatory [deadline] cfq

For example the scheduler deadline delivers best performance on hardware raid and SAN environments. While noop delivers better performance for SSDs.

Switching IO Schedulers on runtime

Set the scheduler for /dev/sda to Deadline:

echo deadline > /sys/block/sda/queue/scheduler

Set the scheduler for /dev/sda to CFQ:

echo cfq > /sys/block/sda/queue/scheduler

Set IO Schedulers permanently

In order to choose a new default scheduler you need to add the following into your /etc/default/grub:

nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="... elevator=deadline"

or:

GRUB_CMDLINE_LINUX_DEFAULT="... elevator=cfq"

After you change /etc/default/grub you need to run update-grub to apply changes:

update-grub

Links