(the ‘Anticipatory’ is now removed). Most distributions use the one called ‘CFQ’ (‘Completely Fair Queuing’ scheduler) but it really depends on the need of the users and the type of computing environments that distribution will be used upon.In the past, Ubuntu’s desktop edition used ‘CFQ’ but with recent versions (including 12.10), ‘deadline’ has replaced ‘CFQ’. I have tested ‘CFQ’ and ‘deadline’, and I can see why ‘deadline’ is being used in Ubuntu, as it gives slightly higher throughput rates (very little) when copying files, and the responsiveness is also better than under ‘CFQ’, when multitasking.That said, when comparing with Windows, though GNU/Linux is far far better than how it used to be, it still feels a bit less responsive, under heavy disk I/O based multitasking. For example, in Ubuntu, if I were to copy a file and while it is being copied, started to open several programs, then sure it slows down their loading times and it is to be expected.But if I were to do something similar in Windows, then according to my experience, the OS’s responsiveness (plus the app loading times) is usually better than in Ubuntu, most probably because the disk I/O scheduler in Windows seems to be a bit better at keeping the OS more responsive, even when other disk I/O intensive programs are running from the background.So out of my frustration, I searched for a solution. And came upon another disk I/O scheduler for GNU/Linux called ‘BFQ’ (it’s actually based on the code of ‘CFQ’). And even before I decided to install it, I got really excited because
it says …One of the nice features of BFQ is that, according to our results, whatever the load is, the disk is virtually as responsive if it was idle.For example, even if one or more large files are being read or written, or else one or more virtual machines are performing I/O, starting a command/application takes about the same time as if the disk was idle.It sounded like the perfect solution ;-), so I decided to install in on my Ubuntu 12.10 and run few tests. Below are their details and the results.I have a Core i3-2330M CPU, 4GB of DDR3 RAM, 320GB Toshiba SATA hard disk (7200 RPM). The tests were run under Ubuntu 12.10.I ran three tests in the default I/O scheduler that comes with Ubuntu 12.10 (‘deadline’) and then ran them all over again with ‘BFQ’ set as the scheduler. I ran each individual test 4 times, to get an average result, and between each test, I rebooted the computer to avoid .According to the ‘BFQ’ developer ‘Paolo’, who is an assistant professor of Computer Science (University of Modena and Reggio Emilia, Italy), ‘BFQ’ also has the ability to give slightly higher disk throughput (sometimes 30% more!).In other words, if I were to copy a file using ‘BFQ’, then it will be copied 30% faster, than other disk I/O schedulers.Update (11/23/2012): This is actually not 100% accurate. Professor ‘Paolo’ was kind enough to put a comment and correct me. So let me comment him here …… a disk scheduler can make a difference with respect to another one, in terms of throughput, only if there are at least two competing applications accessing the disk. Otherwise any good scheduler would achieve more or less the same performance, as it basically just passes requests to the disk in the same order as it receives them.So I decided to test this first (and then move over to testing application loading times under heavy disk ‘I/O’ activity). All I did was very simple, I measured how many seconds Ubuntu takes while copying the Ubuntu 12.10 official disc image (800MB), while no other programs or tasks were running from the background.I ran this test in both ‘BFQ’ and ‘deadline’. Below is the graph that I created by based on the average values.As you can see, ‘deadline’ actually copied the file slightly faster than ‘BFQ’ did, though difference is very little (.5 seconds), it can make a difference while moving a big file (50 seconds change for copying 80GB of data). And I could not see ‘BFQ’ improving my disk throughput as claimed.After the slight disappointment in the first test, I decided to test ‘BFQ’ performance under a heavy disk I/O workload, and how fast a certain application would load.So the second test involved opening ‘LibreOffice Writer’ while copying a file that was about 2.1 GB.Note: (for the extreme geeks: This was actually not a real file copy, instead, I used ‘dd’ to create a 2.1GB file with ‘block size’ set at ‘1MB).Once the 2.1GB file started to copy, I waited for 4 seconds approximately, and then clicked on the ‘LibreOffice Writer’ icon on my ‘Application Launcher, and measured how many seconds it takes for ‘Writer’ to be fully opened.Again, I ran this test 4 times individually in each disk I/O scheduler and below is the graph based on the average results.As you can see, the first time I couldn’t believe it actually, as ‘BFQ’ was able to open ‘LibreOffice Write’ application 262% faster than ‘deadline’ could!. And I also noticed two main things.In ‘BFQ’, the time ‘Writer’ took to load varied a bit. For example, the first time, it took about 18 seconds. But the next time it was reduced to 10 seconds (remember, this is a ‘cold start’ of ‘Writer’. Meaning that I rebooted the PC between each test to avoid any memory Caching), third time 12 seconds and the fourth 17 seconds. And ‘LiberOffice’ started to load with a minimal of delay.But in ‘deadline’, the variation was minimal (38, 37, 37, 38), though ‘LibreOffice Writer’ actually started to load ‘for real’, after the file copy was finished, as its ‘logo’ was just hanging there while the file was being copied.This very similar to the above test. To get more accurate results on how well ‘BFQ’ could perform under heavy disk I/O loads, I decided run another test. I also wanted a more practical example, so I decided not to use ‘dd’ to simulate a disk I/O activity.This time, I copied a real ‘tar archive’ with a size of 1.5GB. And again, 4 seconds after it started to copy, I clicked on the Firefox’s icon on the Application Launcher. Then I measured how many seconds Firefox takes to load, and based on the average value, I came up with the below graph.Note: (I cleared Firefox’s cache after running each test. Plus, also rebooted the computer too).Because of the unusual and scary looking difference between the two rivals, I actually ran more than 8 individual tests :). But the results were always same, with ‘BFQ’ opening Firefox 670% faster than ‘deadline’ did!.Again, I did saw a few variations (seconds) while opening Firefox under ‘BFQ’ (8, 6, 9, 8) where it was quite minimal under ‘deadline’ (53, 52, 52, 52) but when compared the average loading times that ‘BFQ’ delivered, it just made me say, wow!._________________________I could not find a PPA for adding ‘BFQ” into the Kernel that comes in Ubuntu (12.10). Luckily, there’s another kernel called ‘pf-kernel’ that comes with few ‘patches’ or features that are not included in the mainstream Kernel releases (including ).‘pf-kernel’ home page holds a ‘deb’ file that lets you easily install a Kernel that comes with the ‘BFQ’ as the default disk I/O scheduler. To install it, please follow the below steps …Note: Installing a new Kernel is a bit dangerous thing. I did not encounter any issues (except the Ubuntu boot logo got displayed with a wrong aspect-ratio), but please use it at your own risk. I also don’t know if it will work in other Ubuntu versions either (only tested in 12.10).Step 1: First of all, head over to this page.Update (2013/03/21): The above link doesn’t seem to be working anymore and the packages now are provided through .Step 2: Then download the latest Kernel package (the one with the name ‘linux-image …’ — it has both 32-bit & 64-bit packages) & once the downloading completes, double click on it and follow the on-screen details of Ubuntu Software Center to install it.When all is done, ‘pf-kernel’ will be used as the default one when you click on ‘Ubuntu’ from the GRUB menu. If you want, you can access the original Kernel by clicking on the ‘Advanced options for Ubuntu’ sub menu as well.Though ‘BFQ’ is the default disk I/O scheduler, ‘pf-kernel’ comes with ‘CFQ’, ‘Deadline’ and ‘NOOP’. And if you want, once installed, you can easily switch between the I/O schedulers, and do a bit of a testing by yourself too :). For that, please follow the below steps (via ).Step 1: Open your Terminal window and enter the below command.gksudo gedit /etc/default/grubThis will open a configuration file of GRUB bootloader.Step 2: Then locate the below text line.GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”Step 3: Now simply copy and paste the below code after the existing “quite splash”, as shown below.elevator=deadlineNote: You can also use others by simply replacing ‘deadline’ with ‘cfq’, ‘noop’ and ‘bfq’.Now save your changes and exit the editor.Step 4: Then enter the below command to properly update the configuration to GRUB.sudo update-grubThen wait for the ‘done’ message on the Terminal window.Then reboot your computer for the changes to take effect. That’s it.You can use the below command to see which disk I/O scheduler is being used, anytime you want.cat /sys/block/sda/queue/scheduler________________________Few closing words …When comparing with others, ‘BFQ’ is somewhat a newer tool. But that’s nothing compared to what it can do. And
(like 2 years ago). I don’t know why, but for some reason (perhaps it was not that stable back then?), it has not made it.I too have only tested it on a single computer … so I cannot say much about its stability and other issues in a much broader sense. But from my short experience with it, I can say this much.If you want to make Ubuntu impressively responsive so that it will open programs pretty fast when the disk drive is busy while attending to other disk I/O intensive tasks, then you should try ‘BFQ’!.I also do hope that , because everyone loves an OS that performs well under multitasking :P.My tests are very basic ones and if you want more additional details, then please visit
as it contains some complex tests and their results carried out by professor ‘Paolo’ and ‘Fabio’.For those who are interested, assistant professor ‘Paolo’ has also created a 15 min video that compares ‘CFQ’ and ‘BFQ’ as well (below).Good luck.Related PostsAn RHCE, ‘Linux’ user with 14+ years of experience. Extreme lover of Linux and FOSS. He is passionate to test every Linux distribution & compare with the previous release to write in-depth articles to help the FOSS community.Hi Gayan, doesn’t swapability also play a part in this, with Ubuntu swapability default being the server setting, while a desktop machine works better with a lower setting?Just a quick note. Apart from trivial deficiencies, a disk scheduler can make a difference with respect to another one, in terms of throughput, only if there are at least two competing applications accessing the disk. Otherwise any good scheduler would achieve more or less the same performance, as it basically just passes requests to the disk in the same order as it receives them.This is useful to know about Gayan. Paolo, any idea when this will get into Linux upstream?Usually I use the kernel provided by Liquorix:Hi, is it still possible to do that all ? Becouse the site “http://pf.cyberarea.net/” is not working.I suggest to install both. The kernel image and the kernel headers.The reason is, the kernel headers are needed by “dkms” to compile certain modules.HiI have been struggling to make opengl work with kernel 3.8.2-pf.I have an ati card and it’s fully stable and working under:Linux 3.8.0-19-generic #30-UbuntuI installed the amd propietary driver (13.04) by downloading it from the official website and compiling->InstallingI recompiled the same driver under the patched kernel 3.8.2-pf but when I install it, it seems that it can’t find the kernel source (Which I also installed from the website), nonetheless it finish the install successfully but opengl still doesn’t work.Thank you very much for your awesome guides! And hope that I’m just doing something wrong.Have you tried this with either VBox or VMware running Windows? I’ve recently been using Liquorix.Hi, I installed the new kernel in my ubuntu 12.04 system. I think its running fine. But there is a problem. I run my windows 7 on vmware. After installation of the new kernel, vmware is asking me to compile the header files to continue. I downloaded the headerfiles from the link given above, but could not have a progress since the header files are not getting installed. The error shown is given below. Your helps is needed….Code::~$ sudo dpkg -i /home/aneesh/Downloads/linux-headers-3.8.2-pf_1_i386.debSelecting previously unselected package linux-headers-3.8.2-pf.(Reading database … 709434 files and directories currently installed.)Unpacking linux-headers-3.8.2-pf (from …/linux-headers-3.8.2-pf_1_i386.deb) …Setting up linux-headers-3.8.2-pf (1) …Examining /etc/kernel/header_postinst.d.run-parts: executing /etc/kernel/header_postinst.d/dkms 3.8.2-pf /boot/vmlinuz-3.8.2-pfERROR (dkms apport): kernel package linux-headers-3.8.2-pf is not supportedError! Bad return status for module build on kernel: 3.8.2-pf (i686)Consult /var/lib/dkms/bcmwl/126.96.36.199+bdcom/build/make.log for more information.:~$:~$ sudo apt-get install linux-image-generic-ck linux-headers-generic-ckReading package lists… DoneBuilding dependency treeReading state information… DoneE: Unable to locate package linux-image-generic-ckE: Unable to locate package linux-headers-generic-ckHi, I’ve tried this in Linux Mint 13 which is based on 12.04 LTS. Didn’t work on it and had problems with the CPU unlock….and i noticed that immediately the cpu fan was increasing RMP’s and getting noisy…Reading back i wonder weather this works on 12.04 LTS or just after upgrading to 12.10? It didn’t complain about anything with the install though. I would like to give BFQ a try….as I think it’s maybe also a nice scheduler for SSD from what i read. Any idea how I can get this o work?You don’t need to reboot the system just to clear the caches. You can do it by issuing the below command as rootecho 3 > /proc/sys/vm/drop_cachesThis will free all caches, dentries and inodesmost probably because the disk I/O scheduler in Windows seems to be a bit better at keeping the OS more responsive, “I wonder if it’s not also largely because most (all?) linux’ filesystems are more “spread over” the disk to avoid fragmentation, while Windows’ NTFS and FAT are “sequential”, all files are tightly packed next to each other, at the cost of future fragmentation when they’re edited.If that’s true, then we should expect better performance on linux when using tiny/minimal partitions, I guess. I’m not recommending it, I just thought it would be a manner of testing that other than using linux with some fragmentation-prone FS.Using the pf kernel with BFQ on a multi-disk server has made it much more responsive.In normal tasks, I would be transferring data across a network from one or more disks at a time whilst also running various non-intensive background tasks AND browsing folders on various disks on the server.With the default kernel and CFQ, I would be waiting up to 5 seconds to change folder on the server, with the pf-kernel, it is now pretty much instant.Great.ok so here’s the thing:when i runcat /sys/block/sda/queue/schedulerit returns:noop [deadline] cfqEdited the line to this :GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash elevator=bfq”yet bfq does not even display in the return commandi am runningubuntu 16.04 LTSbtw i dont knw wht LTS stands for toojust had it installed on my pc trying to make my pc perform fasteri have acer ao725amd dual core c60 processor with turbo core technology upto 1.33ghz2gb ram500 gb hddalso i would appreciate any help to make things run faster on my netbookSo i already installed kernel on 16.04 LTSThis site uses Akismet to reduce spam. .Recent PostsContactAbout HecticGeekWelcome to HecticGeek, it is an independent blog founded back in 2010. We cover in-depth Linux OS, product review with other all technology-related software and tools. Our mission is to provide valuable and trustful technology-related content to our users.