Fine-Tuning Your I/O Scheduler

Posted by VIOLIN SYSTEMS on Dec 14, 2020 8:42:32 AM

Linux is chosen worldwide to power some of the most powerful computers and systems to keep technology running smoothly. Linux is used in every single one of the world's top 500 supercomputers, placed within every stock exchange on the planet, and even launched into space too.

The computing strength of Linux technology often leaves the Earth with NASA, the ESA, and even private commercial space companies like SpaceX. For instance, SpaceX completed 65 space missions using Linux to power its rockets and explore "the final frontier." 

Linux is an operating system (OS) that is entirely free to use, incredibly user-friendly, and one of the most widespread OSs available. However, as technology advances, humans will expect more and more from technology. To slow latencies and bottlenecks, Linux employs an I/O scheduler to channel and direct read-and-write operations in an organized, timely fashion.

So, what if these schedulers start to slow down? Are you able to adjust them to improve your performance dramatically? Here's what you need to know about your I/O scheduler and the ways you can fine-tune your performance. 

Performing I/O Operations

Input/output (I/O) systems offer a combination of hardware and software, designed to send information back and forth between a primary memory storage solution and the physical world. These systems are composed of I/O devices, control units, and software that all work together to carry out the input-output operation. 

Each operating system has a particular set of code that primarily manages inputs and outputs to boost the operating systems' overall reliability and performance. Input/output requests are handled by device drivers, served by an operating system using three segments: the I/O traffic controller, the I/O scheduler, and the I/O device handler. Here's essentially how each of these components participates in performing input and output requests:

  • I/O Traffic Controllers keep tabs on the status of each device. It controls units and communication channels.
  • I/O Schedulers carry out the operating system's established policies to access the device the way you want, plus grants access to control units and communication channels.
  • I/O Device Handlers manage the transfer of data and serve the device interrupts.

What is an I/O Scheduler?

So, what exactly does an I/O scheduler do? For those who are new to the world of I/O scheduling, the clue is in the name. I/O schedulers schedule activities on Linux-based systems so that resources are ordered and used in an optimal way to achieve the best performance.

However, the definition of "best performance" is —in many ways— dependent on you. You can adjust your scheduler to meet your needs in a system with low latencies for inputs —as is the case for embedded systems, better interactivity, faster inputs-outputs, or some customized combination of goals. I/O schedulers are often concerned with CPU resources, but they can also manage other system resources like memory, input devices, networks, and more. 

Nearly all applications and operations require I/O, including surfing the web, which writes a few small files to the disk. If you did not have an I/O scheduler in place, every new I/O request would interrupt the processes to perform this new request, forcing data around to different blocks to complete the read-write requests. 

Eventually, these kinds of interruptions would create a disparity between the drive's performance and the rest of the system. Additionally, every time the kernel must forcibly address an interrupt (in other words, every time you attempt to do anything!), then all further processing must pause (resulting in a very slow or even unresponsive system). 

I/O schedulers are kernel-level tuners that optimize your disk access requests. You can choose different I/O schedulers to boost your system's performance and select an adequate level for your enterprise. Data-related decisions will depend on your environment type and your workload. Since there is no one-size-fits-all I/O scheduler, you'll discover unique schedulers that will address different needs. Openness to experiment will find the one that yields the best performance increase for you. 

Choosing from I/O Schedulers for Performance Tuning

Technology today is incredibly high-powered; therefore, demanding inputs and outputs happen in large quantities at almost an instant. However, some systems cannot handle multiple requests simultaneously, which can lead to frustrating performance issues. On Linux-based systems, you can address these issues with the performance tuning of your I/O scheduler. 

Some kernel-based Linux virtual machines may demonstrate slow storage performance compared to physical hosts. With Linux 2.6, the kernel has four possible configurations for I/O schedulers:

  • Completely Fair Queuing (CFQ): For many Linux distributions, CFQ is the default configuration for I/O schedulers. It places synchronous requests into several per-process queues and then divides each request into slices of time for each queue to access the disk. Based on the I/O request priority, each queue has a different amount of time to access the disk.  
  • NOOP: The simplest of the I/O schedulers for the Linux kernel. It places all incoming requests into a queue based on a first-in, first-out (FIFO) concept. The NOOP scheduler places these requests in a queue sequentially and implements request merging. This configuration requires I/O performance optimizations to be handled elsewhere in the I/O device handler. 
  • Anticipatory: This type of scheduler uses an algorithm for scheduling I/O requests to improve the efficiency of disk utilization by anticipating multiple, synchronous read operations. 
  • Deadline: A deadline scheduler guarantees a start service time for requests by imposing deadlines on all I/O operations. 

In a virtualized environment, end users are often not served by scheduling I/O at the host and guest layers. So, if you have several guests using your storage or filesystem, you as the host can schedule I/O most efficiently for the host and guest divisions. After all, the host can view both host and guest requests, as well as your storage solution's "physical" layout.

For virtualized Linux guests, testing has demonstrated that NOOP and Deadline configurations can typically improve performance. The best thing to do is experiment with the varying I/O scheduler options to discover the one that works best to optimize your system to its fullest potential.

You can also read more about these configurations and how they can benefit you in our recent post, “Get Optimum Linux Performance with I/O Schedulers.”

Linux, Microsoft’s SQL Servers, and an All-Flash Array

For years, Linux was a perceived competitor to Microsoft's operating system. However, Microsoft understandably made headlines when announcing they produced a Structured Query Language (SQL) Server for Linux


Here’s the deal:

SQL servers and all-flash arrays are proven to be a winning combination when needing to boost performance. All-flash arrays only emphasize the strong performance capabilities of SQL servers. Now with Linux on board and the option to further fine-tune your system, you can fully maximize performance whenever your system must handle multiple read-write operations instantaneously. 

With this unbeatable combination, you get:

  • Lower costs for your storage solution
  • Reliable and Consistent performance
  • Lower latency
  • Flexibility to personalize your I/O scheduling as it fits your needs best. 

By powering your Linux-SQL server from VIOLIN's QV2020 all-flash array, you can keep your data secure and protected with a simple data management interface. Furthermore, you can save on storage costs by switching from slower, more expensive legacy storage solutions. 

Since not everyone works for an IT organization, ask yourself: How can I access Microsoft's SQL server's easy distribution while enjoying the freedom of Linux and the efficiency of an all-flash array? Tell us a little about your unique environment and get answers right for you.

Your team can achieve your goals and serve your infrastructure needs with VIOLIN's high-performance data solutions. Explore the best solution for your specific application here: Talk to an Expert Today!


Topics: IO Scheduler