Linux – Override Default Scheduler for blkio Requests in cgroups

kernellinux

I am trying to optimize a set of servers that have to reside on single machine. i.e. i can have multiple application server, a DB server and of course a samba server as well in same instance. Now I was looking into several optimizing options available to me. In my quest, i did my tuning of the network stack. coming to the CPU, MEMORY and the BLKIO tweaks, i am using CGROUPS. The problem i am facing is that for enhanced performance in the nature of the applications that i am running, the CFQ Scheduler that is implemented for the BLKIO subsystem is not optimal. I was looking more for a Deadline Scheduler because that will serve my purpose well. My question is whether it is possible for us to change the scheduler in the kernel compilation itself for the BLKIO to Deadline and it will reflect in my usage of [CGROUP hierarchies][3]? Since when running the service cgconf, a new fs is mounted and i dont want it to revert to CFQ scheduler.
I also welcome any suggestions that will enable me to have more control over my resources.

EDIT: I am using CentOS 6.2 for the testing. It will be later pushed on Redhat 6.2

Best Answer

I would really like to see you use RHEL/CentOS 6.3. Version 6.2 of EL was short-lived, and many of the bugfixes and enhancements were targeted for the release of newer point-release kernels. Red Hat/CentOS make this extremely clear, since there are NO updates for 6.2, and the packages are only available in the vault archive.

Either way, the tool you should make use of is the tuned and tuned-adm framework. Some of this is detailed here, in this question, with a more storage-focused answer here.

tuned-adm allows you to apply profiles to the system on-the-fly. Enabling a profile with: tuned-adm profile enterprise-storage, for instance, will apply the changes in the last column in the graph below; including remounting the filesystems with nobarrier and changing the I/O scheduler to deadline across the available block devices. Unfortunately, the virtual-guest profile only comes in EL 6.3 or newer... :( Another reason to upgrade...

In the end, tuned is a daemon, so it can be stopped/restarted on the fly. Just reload/reapply the service when a new FS is mounted. It will take care of the rest. You can also create your own profile with sysctl.conf and other performance settings...

enter image description here