Translate

Search This Blog

Best Linux I/O Scheduler(elevator) for Oracle database

There is no single answer for this question but it is easy to answer it depends on your workload.  Beginning from RHEL 4 (Completely Fair Queuing) scheduler is default for all RHEL flavors replacing default anticipatory scheduler and it is good change indeed as anticipatory scheduler was good only for slower disks and it did not go very well with swapping. 

  • But Oracle Enterprise Linux has chosen deadline scheduler as default scheduler for its kernel. Deadline scheduler tends to favor read more than than write unlike CFQ scheduler which treats both read/write as equal priority. And It is considered good for heavy read intensive operations like Data ware house databases but it can go good with OLTP databases also. I would recommend to tweak its disk write timeout attribute and read/write priority to be set equal. 

  • If you are using virtual machine then NOOP(no operation) scheduler is best for you as reordering and merging of disk I/O according to disk sectors etc all is taken care by your Virtual host in most of cases. Similarly NOOP is best for SAN storage for same reasons. Another advantages is NOOP scheduler works on basic elevator algorithm FIFO and consumes least CPU.

  • If you are using Solid sate disks also then NOOP is the only option to you if you are are on versions prior to RHEL 6.[ did not get opportunity to test it ]

I tested my 3 node RAC database test workload on virtual machines with three VDI disks on three different physical disks (equal read and write and I found CFQ and NOOP schedulers) doing better than Deadline and NOOP better than CFQ. But performance of CFQ was consistent more than NOOP. { ofcourse all three RAC nodes had same schedulers ]

It is very easy to change scheduler just place elevator=cfq, or elevator= deadline or elevator=noop  or elevator=ancp in /etc/grub.conf file in kernel you want to boot with and reboot system.

#### snippet of grub.conf to  add elevator=deadline to use deadline I/O scheduler for all disks ###

title Red Hat Enterprise Linux Server (2.6.18-8.el5)
        root (hd0,0) 
        kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/sda2 elevator=deadline
        initrd /initrd-2.6.18-8.el5.img
   Another option from RHEL 5 is you can change it on fly and for specific disks. COOL. so depending on different needs or disk types you can choose different scheduler for different disks. For e.g. if your Linux sever is running Apache server and databases both and both placed on different disks then you may use cfq for apache while deadline for Oracle database and noop for SSD disks.

e.g. If you want noop to be used for disk sdc then you can do this on fly as below:

 echo noop > /sys/block/sdc/queue/scheduler 

Similarly you check  value of above parameter to see what elevator is being used for specific disk device.

In nutshell you need to test system beginning with with theoretically good scheduler setting for each disks for your workload and decide which scheduler gives you best performance.

Follow by Email