[kwlug-disc] MDADM and RAID

Chris Irwin chris at chrisirwin.ca
Tue Mar 2 11:52:33 EST 2010


On Tue, Mar 2, 2010 at 08:05, Lori Paniak <ldpaniak at fourpisolutions.com> wrote:
> What kind of hardware are you running on?  Software RAID 5 is going to
> require a non-trivial amount of CPU power to do the parity calcs.  What
> do 'top' and 'free' say?

My processor is an AMD Athlon 64 X2 4600+. That translates to 2.4GHz
64-bit processor. I'm running 64-bit Ubuntu 9.10 on it. I have 4GB
RAM, free -m reports I have 2GB free. I ran some tests below. I'm not
sure how to do some really objective disk tests, but am open to
suggestion.

During this time I was watching top. dd used 50% CPU (which I believe
means it is 50% of one core, i.e. not maxing out a processor). When it
ran sync, a process called "md1_raid5" used up to 25% cpu. The machine
is otherwise idle at the moment.

My unscientific test command was the following:

for i in $(seq 1 5); do
  sync;
  echo -e "\n===Iteration ${i}===";
  time $( dd bs=1M count=500 if=/dev/zero of=/home/chris/zero; sync );
done

For my raid5 test, I wrote to my home, which is on that array. For my
non-raid comparison (non-raid disk plugged into same controller) I
wrote to where that was mounted. Both are ext4 filesystems. I averaged
the 'real' time over the five runs.

raid5 gives: 12.232
bare disk gives: 6.8586

Now I'm not expecting miracles and I'm willing to take a performance
hit to spare the cost of a dedicated raid controller, but is 50%
throughput really the norm for raid5 with mdadm? And that is just with
this simple test, I experienced much worse than 50% throughput with my
lvm migration....

For anybody who is curious, here is the raw output from my tests:

[chris at jupitertwo:~]$ for i in $(seq 1 5); do sync; echo -e
"\n===Iteration ${i}==="; time $( dd bs=1M count=500 if=/dev/zero
of=/home/chris/zero; sync ); done

===Iteration 1===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.25245 s, 419 MB/s

real    0m11.135s
user    0m0.010s
sys     0m3.430s

===Iteration 2===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.26102 s, 416 MB/s

real    0m11.994s
user    0m0.000s
sys     0m4.710s

===Iteration 3===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.1752 s, 446 MB/s

real    0m12.962s
user    0m0.010s
sys     0m5.180s

===Iteration 4===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.16783 s, 449 MB/s

real    0m12.707s
user    0m0.010s
sys     0m5.160s

===Iteration 5===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.16648 s, 449 MB/s

real    0m12.362s
user    0m0.000s
sys     0m4.710s


[chris at jupitertwo:~]$ for i in $(seq 1 5); do sync; echo -e
"\n===Iteration ${i}==="; time $( dd bs=1M count=500 if=/dev/zero
of=/mnt/backup/chris/zero; sync ); done

===Iteration 1===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.14573 s, 458 MB/s

real    0m6.909s
user    0m0.000s
sys     0m4.240s

===Iteration 2===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.24725 s, 420 MB/s

real    0m6.886s
user    0m0.010s
sys     0m4.350s

===Iteration 3===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.20556 s, 435 MB/s

real    0m6.856s
user    0m0.000s
sys     0m4.480s

===Iteration 4===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.11238 s, 471 MB/s

real    0m6.663s
user    0m0.000s
sys     0m4.370s

===Iteration 5===
500+0 records in
500+0 records out
524288000 bytes (524 MB) copied, 1.25068 s, 419 MB/s

real    0m6.979s
user    0m0.000s
sys     0m4.530s


-- 
Chris Irwin
<chris at chrisirwin.ca>



More information about the kwlug-disc_kwlug.org mailing list