Getting hard disks up to DMA speed on Proliant ML110/CentOS Linux

published Oct 27, 2009 10:15   by admin ( last modified Oct 27, 2009 10:15 )

 

Summary: Editing the menu.lst file in the grub directory of the /boot directory to include "ide0=noprobe ide1=noprobe" as parameters for my default boot option worked for me. Your mileage may vary of course

 

A machine that I use as a home server, a HP Proliant ML110 G5, has taken very long to copy large files. A 5GB file seemed to take about 3 hours. This is of course wholly unreasonable. Something must be wrong, but where? I suspected it wasn't using DMA mode, which is a quicker mode of data transfer. Googling around I found that the hdparm should be able to check DMA mode and set it if not enabled. Well hdparm reported it was not set and furthermore that it could not be set. A hint that something was wrong was also that the drives where identified as /dev/hd*, not /dev/sd*. So further googling revealed it could be a BIOS setting. I looked into BIOS but everything was OK there. Eventually I found this page that says that the correct kernel driver may not be loaded, and instead a generic very conservative driver is loaded:

Google suggests booting with ide0=noprobe ide1=noprobe to make sure the ata-piix driver is used. If you don't want to reinstall then make sure initrd contains the ata-piix driver and that references to /dev/hd* are replaced with /dev/sd* in fstab etc.

Read more: [CentOS] Re: DMA mode

 

So the question is: Do I have the ata-piix driver on my system? It is probably not a good idea to disable something and not having the thing you want to have enabled, installed. It turns out the file you should be looking for on the file system (at least on  my CentOS) is called "ata_piix", not "ata-piix".

I edited the menu.lst file in the grub directory of the /boot directory to include "ide0=noprobe ide1=noprobe" as parameters (You may want to make a new boot option for this so you can easily go back). I then rebooted and edited fstab to mount the new /dev/sd* devices after checking in /dev what they were, and rebooted again.

Before and after

Before the performance according to hdparm was like this:

/dev/hda:
 Timing cached reads:   5052 MB in  2.00 seconds = 2526.92 MB/sec
 Timing buffered disk reads:   10 MB in  3.71 seconds =   2.69 MB/sec
[root@firefly ~]# hdparm -tT /dev/hdc

/dev/hdc:
Timing cached reads:   4920 MB in  2.00 seconds = 2460.83 MB/sec
 Timing buffered disk reads:   10 MB in  3.71 seconds =   2.70 MB/sec
[root@firefly ~]# hdparm -d1 /dev/hdc

 

And now it is like this:

 

[root@firefly ~]# hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   4948 MB in  2.00 seconds = 2475.64 MB/sec
 Timing buffered disk reads:  180 MB in  3.02 seconds =  59.53 MB/sec
[root@firefly ~]# hdparm -tT /dev/sdb
/dev/sdb:
 Timing cached reads:   4840 MB in  2.00 seconds = 2421.36 MB/sec
 Timing buffered disk reads:  286 MB in  3.02 seconds =  94.67 MB/sec

 

So a neat improvement on buffered disk reads of factor 35 or 3500% on my second disk, and an improvement of factor 22 or 2200% on the slightly older drive. Copying the 5GB file now seemed to take around 2 minutes, which is an even bigger difference in speed.

 

Here is some background information on SATA in Linux and drivers.