Choosing the right input output scheduler for Oracle on Linux

As I’ve wrote about before, having an understanding of the stack of software and hardware you are running workloads on is critical to getting the best performance out of your environment.

In all Linuxes (SuSE, RHEL, OL) for which Oracle supports running Oracle database, the kernel is responsible for scheduling the I/O in the system. There are multiple schedulers built into the kernel to allow you to choose the best scheduler for your disk I/O profile. For example, a database server is going to have a much different disk I/O profile than a webserver.

As you can read in this 2005 article from RedHat on RHEL 4 or this last revised 2008 pdf, there are significant benefits to be gained for your OLTP database server by changing your I/O scheduler from the default cfq (Completely Fair Queuing) to “deadline”. Deadline scheduler attempts to reduce latency of any given single I/O by waiting as long as possible before writing buffers to disk.

It’s interesting to note that, according to the Oracle Linux 6 release notes, Oracle’s Unbreakable Linux (UEK) kernel uses the deadline scheduler. Compare this with RedHat’s kernel which uses cfq by default. I wonder how much of Oracle’s performance improvements supposedly from UEK are actually from using a more appropriate scheduler for typical database workloads? I also wonder if deadline would be the right choice for Exadata, which uses UEK, since it has SAN type storage built in.

So the answer here is always use deadline scheduler, right?

Not so fast. What if I’ve virtualized my database and I’m running it under VMware or on a Storage Area Network (SAN)? VMware has designed vSphere as an Operating System (OS) optimized to run other OSes. You can find a fascinating thread on quora about vSphere and how it compares to other OSes.

Is deadline still most likely the best choice?

No. Even as of May 2010 in this paper from VMware on Oracle Databases on vSphere 4, there is NO mention of what scheduler to use.

So, as always, you should be diligent and work with your system administrators to test out what works best in your environment. Having said that, based on my experience and that of others, I typically set the scheduler to noop (No Operations) on all my linux VMs, regardless of if they are running Oracle or not.

3 thoughts on “Choosing the right input output scheduler for Oracle on Linux

  1. Hey, have been searching on Yahoo for that topic, finally found your article! First informative post. Well written and researched. Will check your other story now and will most probably come back in the future! Best regards

  2. >Oracle’s Unbreakable Linux (UEK) kernel uses the deadline scheduler

    …in all the testing I’ve done both while working in Oracle Server Technologies and outside Oracle I’ve found that deadline is the safest choice for RAC but not necessarily the best performing scheduler for all use cases. Since OEL6 is not even supported with Oracle Database yet this may change as users in the field adopt the platform, test and feedback…perhaps.

  3. I tested noop, deadline and cfq all for my Oracle RAC databases on vmware and Oracle Virtual box. I had read and write almost equals. I found cfq and deadline were closer though cfq slightly was better than deadline. And I found noop was best but timings with noops were not consistent. For typical prod case where there will be more read than writes deadline should be choice but its read and write priority should be set equal and the timeout

Leave a Reply

Your email address will not be published. Required fields are marked *