Painfully slow CentOS system

Today I was installing CentOS 5.2 to a Tyan barebone server with Intel Xeon X3220 processor, 2GB of RAM, and 2 Western Digital SATA II 250GB HDD. I chose to use software RAID 1 for my /boot and /. I didn’t create RAID 1 for swap partition because it is useless and in fact it might slow down performance. It took more than 2 hours to complete the whole installation process even when I used bare minimum packages selection. The format process of / partition itself took quite a while to complete.

Once the installation was complete, it rebooted and I found a painfully slow newly-installed CentOS system. The keyboard response was slow as if I were connected to a remote server with 1 second latency. I wasn’t happy because this is a quad-core processor server with acceptable amount of RAM. When I looked at /proc/mdstat to see how the software RAID is doing, I noticed that the sync speed is only around 1000KB/s. I tried looking for solutions on Google and found this and this. The solution I got didn’t help increase the sync speed, nor the slow response I was getting typing on the console or remotely.

I then somehow managed to find another possible solution. I can’t remember how I finally got this solution (thanks to nixCraft/CyberCiti). I didn’t notice that the hard drives were actually detected as hdX (IDE/PATA) instead of sdX (SATA). Now this makes sense because PATA is much slower than SATA. It turned out to be an issue with the hardware detection process. Somehow CentOS detected the HDDs and used PATA driver instead of SATA driver, so the devices were named hdX and treated as PATA hence the slow sync speed. I made the BIOS changes as mentioned in the solution and attempted another install, it was REALLY fast this time and the software RAID 1 sync speed was over 70000KB/s.

References:
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=16178
http://lists.centos.org/pipermail/centos/2005-February/002068.html
http://www.ducea.com/2006/06/25/increase-the-speed-of-linux-software-raid-reconstruction/
http://www.cyberciti.biz/faq/linux-sata-drive-displayed-as-devhda/
http://www.nodeofcrash.com/?p=57

4 thoughts on “Painfully slow CentOS system

  1. Thank you SO much for this article. My sync speeds were only 3000kb/sec and after this fix they are 100000kb/sec+. i knew something was wrong with a dual core processor with 4gb ram hardly responding to keystrokes. Thanks so much!!!

  2. I didn’t create RAID 1 for swap partition because it is useless

    What you’re doing, is making your other RAID 1 useless. If you reach your memory level and begin to use swap space, all thoose applications using swap space will segfault when the swap disk dies. You could potentially crash your whole machine.

  3. AHA, yes.. Good point. Thanks for pointing this out. 🙂
    I didn’t consider that scenario when I wrote that post.

  4. Thank you Adryan, had this problem with some SATA HDDs in mirror 1 software RAID.

    All I did was : “Native Mode Operation” set to “Serial ATA” (it had the default BIOS option).

    I had to recompile the kernel with SATA support because it was an old Slackware 🙂 But for the new distros you shouldn’t need to do that.

    You saved the (many) “dayS”, thank you 🙂

Leave a Reply

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

Anti-Spam by WP-SpamShield

reductive-referenced