LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-22-2012, 07:38 AM   #1
dschuett
Member
 
Registered: Aug 2010
Posts: 40

Rep: Reputation: 1
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
 
Old 05-23-2012, 04:03 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
  


Reply

Tags
debian64, mdadm, raid0



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't I mount this md0 raid? (mdadm and software raid) cruiserparts Linux - Software 35 01-05-2013 03:35 PM
Debian 5 mdadm "device or resource busy" raid edwardzc Debian 1 12-27-2010 04:52 AM
Broken raid 5 (11 drives in mdadm) -- data recovery/raid reconstruction needed -- ple jml48197 Linux - Server 4 07-27-2010 12:57 PM
Dell/Intel ICH7 soft-RAID and mdadm raid-level mistake PhilipTheMouse Linux - General 0 03-14-2009 05:59 PM
RAID mdadm - Sending E-Mails on RAID Failure? rootking Linux - General 1 12-25-2007 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration