LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   mdadm RAID 0 slow - Debian 6 (http://www.linuxquestions.org/questions/linux-software-2/mdadm-raid-0-slow-debian-6-a-946287/)

dschuett 05-22-2012 07:38 AM

mdadm RAID 0 slow - Debian 6
 
I have 2 1TB drives in mdadm raid0 array. The array is used for storage only; Debian Squeeze is installed on a separate 10K RPM drive. I have configured this mdadm raid0 array countless times on Ubuntu with great results in terms of speed, but I have moved to Debian and the same raid0 setup is very slow as you can see:

# mdadm --detail /dev/md0
Code:

/dev/md0:
        Version : 1.2
  Creation Time : Fri May 18 08:02:44 2012
    Raid Level : raid0
    Array Size : 1953518592 (1863.02 GiB 2000.40 GB)
  Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Fri May 18 08:02:44 2012
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

    Chunk Size : 512K

          Name : greenmachine:0  (local to host greenmachine)
          UUID : 9584c6af:67856396:889313d3:9ad2d222
        Events : 0

    Number  Major  Minor  RaidDevice State
      0      8      17        0      active sync  /dev/sdb1
      1      8      33        1      active sync  /dev/sdc1

# dd if=/dev/urandom of=/Godfather/file.out bs=1M count=10240
Code:

10+1 records in
10+0 records out
10485760 bytes (10 MB) copied, 1.95041 s, 5.4 MB/s
21+2 records in
21+1 records out
22849526 bytes (23 MB) copied, 3.9704 s, 5.8 MB/s
32+3 records in
32+2 records out
34902582 bytes (35 MB) copied, 5.9784 s, 5.8 MB/s
43+4 records in
43+3 records out
46843548 bytes (47 MB) copied, 7.9864 s, 5.9 MB/s
54+5 records in
54+4 records out
58821174 bytes (59 MB) copied, 9.9944 s, 5.9 MB/s
65+5 records in
64+5 records out
69754174 bytes (70 MB) copied, 11.9801 s, 5.8 MB/s
76+6 records in
76+5 records out
82337086 bytes (82 MB) copied, 14.0064 s, 5.9 MB/s

Any ideas on why this might be so slow?

* Note: this is the howto I have always referred to: http://sebby.cc/?p=340

TobiSGD 05-23-2012 04:03 PM

It is slow because you use urandom.
To demonstrate that I make your test on a filesystem that is mounted to RAM, so that disk speed is not a limiting factor:
Code:

tobi@demon /ram :) % dd if=/dev/urandom of=test.img count=1024 bs=1M
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 65.155 s, 16.5 MB/s

Now I do the same with the faster /dev/zero:
Code:

tobi@demon /ram :) % dd if=/dev/zero of=test.img count=1024 bs=1M
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.627626 s, 1.7 GB/s

Now the same test on a RAID 0 (2x 500GB, software RAID):
Code:

tobi@demon /ram :) % dd if=/dev/urandom of=/data/test.img count=1024 bs=1M
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 65.8429 s, 16.3 MB/s
tobi@demon /ram :) %
tobi@demon /ram :) % dd if=/dev/zero of=/data/test.img count=1024 bs=1M 
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 6.51105 s, 165 MB/s

As you can see, the limiting factor is not the speed of your array, but the limited speed of the /dev/urandom device. Try it again with /dev/zero.


All times are GMT -5. The time now is 03:50 AM.