This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Build a faster desktop with RAID

By Simon Kaczor on January 17, 2008 (4:00:00 PM)

Share    Print    Comments   

The evolution of computing is characterized by a vertiginous acceleration of speed and capacity. As we install sophisticated applications and make use of computers in more creative ways, storage needs are pushed even further. You can improve your disk performance by using a RAID-enabled desktop system running common OSS applications.

A typical hard drive is 100 times slower than memory while reading sequential blocks of data. If the data is scattered across the disk, the performance becomes even worse. Add multi-tasking to the equation, and the typical computer will start showing little progress on the screen. Fortunately, Linux makes Redundant Arrays of Independent Disks (RAID) accessible on the desktop, even for cost-conscious users.

To see how RAID can improve performance, I created a test rig out of an average desktop machine with two identical Serial ATA hard drives. The results are shown in the table below.

System
Processor AMD BE-2400 (Dual Core, 2.3 GHz)
Motherboard MSI K9MM-V (Micro ATX, 2 SATA 1.5 GHz channels)
Memory 2 x 1 GB, OCZ Dual Channel DDR2 800
Hard Drive 2 x 160 GB, Hitachi Deskstar 7K250
Software
OS/Desktop Kubuntu 7.10 32-bit, KDE 3.5.8
Productivity OpenOffice.org 2.3, Firefox 2.0.0.11
Development KDevelop 3.5.0, GCC/G++ 4.1.3
Multimedia Kino 1.1.0, Gwenview 1.4.1

To better understand the benefits of a RAID, I looked at the performance of a KDE-based Linux desktop using three different disk configurations:

  1. Single-disk configuration
  2. Two-disk striped setup (RAID 0)
  3. Two-disk mirrored setup (RAID 1)

The goal is to evaluate performance gains of a two-disk configuration (2 and 3) over a single-disk setup (1). Using each of the three configurations, I performed a series of disk-intensive tasks and measured the total execution time. The selected tasks represent operations that need to be repeated on a regular basis by three categories of users:

  1. Productivity and multitasking
    1. Start the system, including loading a KDE session (Web browser, instant messenger, email, music player, and file explorer)
    2. Light multitasking: burn a CD and start OpenOffice.org Writer at the same time
    3. Heavy Multitasking: start Firefox under a heavy disk load (slocate indexing all files in the background)
  2. Software development
    1. Run a full compilation of KStars
    2. Start KDevelop
    3. Debug KStars after modifying its code using KDevelop
    4. Find a file in the KDE Education Project's source tree
  3. Content creation and entertainment
    1. Export a six-minute video clip using Kino's raw DV format
    2. Encode and create a six-minute DVD using Kino
    3. View a year in pictures using Gwenview (1,300 digital photos displayed as 48x48 thumbnails)

 

Productivity and multitasking

In theory, you can double sequential reads using a two-disk mirrored array. You can also double sequential writes by making it a striped array. In practice, the real-world performance gain is much smaller in most areas. As you can see on the Productivity Results chart (Figure 1), the total system startup time is reduced by 12 seconds for both dual disk setups, which is not bad if you are in a rush to check the local weather before leaving for work in the morning.

But the best improvement comes when you're running more than one disk-intensive operation at the same time. In that situation, the performance gains are astonishing. Rather than waiting for the browser to start for almost a minute, you can have a Web browser up and running in 8 seconds while some other programs are intensively searching for data.

The mirrored array has a clear advantage for multiple reads. This is in line with the theory; the same data can be found on two independent disks. The system can therefore distribute concurrent read operations thus significantly improving the overall performance.

Software development

Software is rarely assembled from large blocks of data; it is usually spread across multiple small files to increase the readability of source code. For that reason, there is little to be gained from a striped setup because that configuration works better for sequential reads. Mirroring, on the other hand, could prove more useful for development tasks that run multiple operations in parallel.

With the exception of the full compilation, none of the development tasks I ran is multithreaded, so only small performance gains are apparent on the chart (Figure 2). Even the full compilation doesn't show a big improvement because it is CPU-intensive and the disk is seldom being accessed during the test.

The test results could have been different if more tasks were simulated at once, such as loading files while a large project is being compiled. It is also possible that a quad-core CPU could benefit more from a dual-disk array during the full compilation.

Content creation and entertainment

Home video editing is a rewarding hobby, but since uncompressed video requires huge amounts of disk space, the performance of the storage system is critical to quick execution. With inadequate disk throughput, videos will load and save for extended periods of time, distracting you from the task at hand.

A very significant improvement in Video and Picture editing using RAID 0 In the content creation arena, the RAID 0 striped array contender is the hands-down winner. As you can see on the Multimedia Results chart (Figure 3), videos will save in half the time, and you can browse years of digital photography in a snap. The chart shows less benefit for RAID 0 in creating DVDs because it is a CPU-intensive process. But once you are satisfied with the movie, you can relax while Kino is creating and burning the DVD.

Conclusion

My tests show a significant improvement with dual-disk desktop performance. The performance gain is more significant in some areas, such as video editing. If you store large amounts of data and need to load it on a frequent basis, you will benefit from RAID configuration for a little extra investment in hardware. It is strongly recommended that you use identical disks for an array -- so for your next upgrade or new desktop computer purchase, order two hard drives instead of one.

In choosing a configuration, you should consider several factors. For instance, for valuable data, you should think twice before choosing a striped array. RAID 0 is less reliable than a single disk setup: you will lose your data if either of the disks fails. For this reason, if striping works best for you, frequent backups are a must. On the other hand, you can also mix and match both configurations. You could set up a mirrored array for the operating system and most of your user directory, and a striped array for temporary work folders that have a need for speed.

Simon Kaczor is a software developer who lives in Roanoke, VA. He has been an avid Linux fan since v0.99.

Share    Print    Comments   

Comments

on Build a faster desktop with RAID

Note: Comments are owned by the poster. We are not responsible for their content.

Build a faster desktop with RAID

Posted by: Anonymous [ip: 69.62.137.201] on January 17, 2008 05:48 PM
How was the RAID created? External controller or Linux Software RAID (mdadm, etc.)?

#

Re: Build a faster desktop with RAID

Posted by: Simon Kaczor on January 19, 2008 03:22 AM
The test setup consists of two hard drives attached to the integrated SATA controlers on the motherboard (no add-on card was used) with Linux software RAID. I found the software RAID to be much easier to configure and the typical built-in BIOS RAID on most motherboards is rarely supported by the Linux kernel. Besides, even if you use the BIOS RAID (aka Fake RAID), it is still a software RAID...
[Modified by: Simon Kaczor on January 19, 2008 03:38 AM]

#

What about RAID 5?

Posted by: Anonymous [ip: 209.34.247.240] on January 17, 2008 06:34 PM
It would have been nice to see how RAID 5 compared to RAID 0 and RAID 1.

I also would have liked to know a little bit more about your RAID setup (hardware or software RAID, stripe size, etc.)

#

Re: What about RAID 5?

Posted by: Simon Kaczor on January 19, 2008 03:25 AM
To make RAID appealing to mainstream users, I selected a low budget desktop system for the test. RAID 5 is not an option with that MB since a minimum of three drives are needed and the MB has only two SATA ports.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 91.84.210.187] on January 17, 2008 06:40 PM
Given that hard disks have lagged behind the gains observed by Moores Law; I am starting to believe that: all servers should be RAID 1 (or better reliability) and all desktops should be RAID 0 (or better performance).

The thing I appreciate about your article is the statistics that quantify the gains.
It is also interesting to see a performance gain from RAID 1 albeit small.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 170.135.241.45] on January 17, 2008 07:17 PM
Seriously when is someone going to do a solid
(2 Drives)
Raid 0
Raid 1
(4 and 6 drives for the following)
Raid 10 or 01
Raid 5

comparison when dealing with 7200 rpm drives and 10,000 rpm drives?

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 24.255.195.197] on January 17, 2008 07:22 PM
Nice article - but where's the newbie walk through on how to set this up?

#

Re: Build a faster desktop with RAID

Posted by: Simon Kaczor on January 19, 2008 03:30 AM
I skipped the newbie talk since many distros come with a pretty nice installer. I suggest using the Ubuntu/Kubuntu alternate CD, which will guide you through setting up a Software RAID or LVM partition. One detail to remember is to create a small partition (200 MB should be plenty) for /boot outside of the RAID/LVM partition because GRUB doesn't support booting from a RAID 0 partition.
[Modified by: Simon Kaczor on January 19, 2008 03:36 AM]

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 24.255.195.197] on January 17, 2008 07:22 PM
Was this software or hardware RAID?

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 74.77.179.107] on January 18, 2008 04:11 AM
Why no details on the RAID hardware/software used?

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 84.90.182.83] on January 18, 2008 07:22 AM
It sure would be nice if you walked through the steps of creating the RAID setup...although this article is an "ok" benchmark, its pretty useless :\

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 80.248.46.215] on January 18, 2008 08:35 AM
Newbie HOWTO: you buy an MSI K9MM-V (see http://www.msicomputer.com/product/p_spec.asp?model=K9MM-V ) and use its RAID-0 or -1 config.
J...

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 65.211.167.218] on January 18, 2008 02:52 PM
md RAID in the kernel is a solid performer, and included in the OS. I usually build two mirrors - a 200MB one for /boot, and the balance for LVM. With the dual-core (or higher) processors, the IO advantage easily outgains the CPU overhead.

#

Re: Build a faster desktop with RAID

Posted by: Anonymous [ip: 71.15.112.90] on January 18, 2008 08:30 PM
Don't forget LVM supports RAID0.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 128.193.165.46] on January 18, 2008 04:46 PM
I second the addition of a RAID 5 comparison

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 69.62.137.201] on January 18, 2008 06:29 PM
RAID 5 comparison won't help you if we don't even know what he is comparing. Is this hardware or software (Linux MD layer) RAID in the benchmarks? How was the RAID created?

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 217.216.157.2] on January 20, 2008 03:10 AM
Raid 0 is no really Raid because it is not redundant

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 80.202.233.229] on January 20, 2008 11:33 PM
One thing though; the NOISE! Cant stand it, so no no for two disk to work at the same time all the time on my pc!

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 24.60.24.191] on January 21, 2008 06:52 AM
Save up for a couple solid state disks for quietness. :)

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 76.4.43.141] on January 21, 2008 10:51 AM
I just ordered a couple 1TB 7200 SATA drives and want to use a SATA raid card, I have plenty of SCSI raid cards (32mb-128mb). I like hardware (real hardware) raid better than software raid from past experience. Being new to Linux but loving it all my raid experience is with gestapo software. Recomendations on good supported SATA raid card (real raid) for raid 1-5 would be very, very helpful.

#

Re: Build a faster desktop with RAID

Posted by: suchi on January 21, 2008 12:55 PM
3ware SATA RAID controllers would be an ideal choice, but if you do not want to spend that much, i suggest you partition both disks exactly the same way, and use mdadm (or similar) to create a software RAID, that should be as efficient...

ps: xfs would be a good filesystem choice for all but the boot partition (say 200M as someone suggested, which should be on both drives, but unRAIDed ...)

#

Re: Build a faster desktop with RAID

Posted by: Anonymous [ip: 69.20.166.226] on January 21, 2008 09:25 PM
--- Truth told, Linux (mdm native, not FakeRAID) softRAID actually offers better read performance then most hardware RAIDs cards. The reason being is that Linux natively multi-threads and does a split reads when possible (reads from both/all disks simultaneously). It (sadly) appears that many hardware RAIDs fail this test (including 3ware 9xxx series based on my testing). If you want a hardware RAID solution that does manage multi disk reads consider the Areka models.

--- RAID 5 should actually be lower performance than RAIDs 1/0. The reason is the overhead of calculating parity bits. It is not unusual for Hardware RAID5 to perform on par with a single disk write. The hardware CPU unit spends it's extra time in parity. If you are going to RAID5 in software, go with a multi-core CPU configuration.

--- Of course if you want ultimate performance (price be damned) pair an Areka with Mtron SSD units. Using 5 64G Mtrons in RAID5 we attained over 400Mb/sec write performance and about 450 Mb/sec reads.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 61.16.151.61] on January 21, 2008 12:41 PM
3-ware makes some excellent 'real-hardware' RAID controllers, and they are fully supported under linux. you could try them. apropos linux software RAID is equally good, so long as you are working with multiple disks (say 5 hdds for a RAID 5 with hot-swap)...

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 61.16.151.61] on January 21, 2008 12:43 PM
... and here is the link for 3-ware: http://www.3ware.com/products/index.asp

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 24.62.104.244] on January 21, 2008 02:04 PM
Why is the RAID 1 performance better than the RAID 0 performance on the multitasking benchmarks? I would have guessed that RAID 1 would perform about the same as a single drive, perhaps worse. Does Linux Software RAID 1 fetch both copies of the data simultaneously and then use the first to arrive? If that's the case it would explain the performance improvement because access times are much more important than bandwidth and simultaneous reads of both disks could reduce the average access times significantly.

#

Re: Build a faster desktop with RAID

Posted by: Anonymous [ip: 129.33.1.37] on January 21, 2008 02:22 PM
I'm going to put out a guess here about Linux RAID1, but would be happy if anyone has a more informed opinion...

I'm going to guess/hope that RAID1 is capable of being quite flexible, based on the current workload. First off, it should never be necessary to read both drives for any given read request, unless one drive returns an error. In normal lightly-loaded operation, I would expect/hope for RAID1 to ping-pong requests between the 2 drives, both in order to equalize the drive usage and to get "striping-like" benefits of RAID0 out of RAID1. Under more heavily-loaded conditions I would expect/hope for RAID1 to seek-optimize the requests, essentially sending one stream of requests to one drive, and another stream of requests to the other drive. In this way, RAID1 could do some heavy seek optimization under multitasking that RAID0 can't.

I run kernel RAID1 simply for the data integrity, and had kind of hoped for the type of actions that appear to be shown in these benchmarks.

#

Re: Build a faster desktop with RAID

Posted by: Woody on January 21, 2008 11:00 PM
RAID1 performs better than a single drive because of split reads (with an assumption that in these test, there was more reading than writing or that the required writing was within buffer size such that reading is the determining factor). The Linux softRAID reads from both drives in a mirrored pair thereby doubling the read performance. While in RAID0, the softRAID reads from both drives, it must spend time calculating which drive has what data to read giving RAID1 a slight advantage (both drives have the same data in RAID1). RAID0 wins on write performance because the write is spit across drives (1/2 in each direction). In RAID1 however, the writes a the same as a single drive as both drives must get the full write (mirror).

--- Sadly most other softRAIDS (promise/adaptec, marvel, intel) are single drive read. Even more sad is that most hardware RAID cards read single drive at a time. Areka seems to be the bright spot in my work tests. They seem to split read/write very effectively. See my previous comment about the 400/450Mb sec Areka/Mtron SSD setup.
[Modified by: Woody on January 21, 2008 11:02 PM]

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 72.11.69.215] on January 21, 2008 07:03 PM
I have used Areca Hardware RAID cards and they are excellent. They are very well supported in Linux. The ones used were SATA2, PCI Express cards (1210). They also have PCI-X cards.

http://www.areca.com.tw/

Google for reviews.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 65.122.178.131] on January 21, 2008 07:17 PM
In building a "Faster" File Server would it be better to have:
1) a small drive for the OS and two drives in RAID1 for the data
2) two drives in RAID1 for OS and data

#

Re: Build a faster desktop with RAID

Posted by: Woody on January 21, 2008 11:14 PM
If all you built was a simple file server, it should not matter where you put the OS as what of the OS you need should be in memory post-boot. You disk access should be limited to read/write of the data being shared unless you built a file server with not enough RAM to hold the kernel and Samba in memory (and if you did that your data access is going to be absolutely horrible). In a heavy use file server, you want lots of RAM for I/O buffering and most likely a preference to low seek times on your drive configuration as most file access is read rather than write (with some exceptions). RAID1 should be ever-so-slightly faster than RAID0 for reading as RAID1 knows all data is on both drives. In RAID0, it has to spin some time determining which drive what data is on. In both cases, Linux's softRAID with perform split reads. RAID0 with offer faster writes as data is written 1/2 to each drive. RAID1 has to write all data to both drives. RAID0 is what you want for video editing. RAID10 (4 drives) if you want speed *and* redundancy.

--- As a footnote, RAID5 will not offer a large read performance boost over a single drive setup due to parity calculations. It may offer a slight write improvement as it takes less time to calculate parity and write some data to each drive than write all data to one/every drive. YMMV.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 193.113.48.17] on January 23, 2008 12:57 PM
Hi,

I am struggling to beleave that mirroring is faster than striping. There must be a lag on the SATA controller or something, beacuse stripping main benifit over mirroring is its performance.

Can you possibly explain that.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 130.243.219.230] on January 23, 2008 08:03 PM
Wiki for setting up FAKE RAID in (arch)linux using dmraid:
http://wiki.archlinux.org/index.php/Installing_with_Fake-RAID

For a list on tested hardware check links at bottom of that page.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 24.18.194.194] on January 29, 2008 03:31 PM
Is it possible to have two RAIDs in the same system? I want to do 2 HDs as RAID 1, and 3 HDs as RAID 5. I am using a Intel dg33tl MB w/5 internal SATA and 1 external SATA.

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 190.76.39.67] on February 20, 2008 03:45 PM
I am using Edubuntu 7.10 with buildin ltsp5 on a server that has 2 sata disks configured as raid1 with mtadm but the system is slow.. very slow..
using AMD 4600+ dualcore with 2 gb memory (800 mhz) and Biostar Tf7025-m2 motherboard.

Why is it so slow..?!.

Thank you..

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 192.55.52.1] on February 22, 2008 04:19 PM
To all who want a HOWTO: Google "mdadm raid" and you'll find all you need. mdadm is a pretty simple tool and you can find lots of examples of usage.

Yes, you can do multiple software RAIDs on one system. I've had RAID 0 and RAID 1 running side-by-side. I've also had RAID 5 running with mdadm (with an old Adaptec SCSI card - not a RAID card). Heck, if you've got 2 SATA ports and 2 IDE ports (4 drives), you can mix/match RAID pretty easily. Drives are cheap. If you've got a newer board with up to 6 SATA ports, RAID 5 becomes a very attractive option. The only problem is that you can only boot from RAID 0 or 1, not 5.

I've done this with SATA, IDE, SCSI. mdadm doesn't really care - it just wants disks. Feed me, Seymour!

My favorite part of this is running RAID 0 on 2 SATA 7200rpm/8MB buffer drives with those FPS games that have huge levels - they used to take forever to load and now they EASILY load about 2x faster (as you'd expect). Still sucks on a LAN game when I have to wait for everyone else to finish loading, though. >:)

#

Build a faster desktop with RAID

Posted by: Anonymous [ip: 210.212.4.234] on March 10, 2008 09:19 AM
Hi,

What tool did you use to obtain the benchmarking results?

Kindly let me know

Thanks,
Amit <amitksaha@netbeans.org>

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya