xiao
Posts: 1
Joined: Fri Jul 12, 2019 3:04 pm

about cpu usage rate and hard disk usage rate after set Raid 1

Fri Jul 12, 2019 4:20 pm

hello

my pi is 3B+ and i have two 4T hard disk

i want to set hard disk to raid 1 mode, my step :

Code: Select all

parted /dev/sda
mklabel gpt
mkpart primary 1M 4001GB
q 
parted /dev/sdb
mklabel gpt
mkpart primary 1M 4001GB
q 
sudo mdadm --verbose --create /dev/md1 --level=raid1 --raid-devices=2 /dev/sd[ab]1
sudo mkfs.ext4 /dev/md1
is this correct or not?? i am a beginner , i googled and get these command :)

i found questions after mount /dev/md1 :(i do not know if it is normal or not :) )
1. cpu usage rage of command named usb-storage rate is about 5% - 8%
2. usage rage of hard disk /dev/sd[ab] (not /dev/md1) are close to 100%

so , please help me to figure out thest questions. Thanks.

top:

Code: Select all

top - 00:14:02 up 25 min,  2 users,  load average: 2.44, 0.91, 0.33
Tasks: 146 total,   5 running, 140 sleeping,   0 stopped,   1 zombie
%Cpu(s):  4.8 us,  5.0 sy,  0.0 ni, 65.1 id, 24.8 wa,  0.0 hi,  0.3 si,  0.0 st
MiB Mem :    926.1 total,    569.2 free,    137.5 used,    219.4 buff/cache
MiB Swap:    100.0 total,    100.0 free,      0.0 used.    719.3 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                  
  429 root      20   0   39072  21408  12480 R   9.4   2.3   0:08.72 vncserver-x11-c                                          
 1144 pi        20   0  180992  52856  41508 S   8.8   5.6   0:05.49 lxterminal                                               
  508 root      20   0  187844  49036  32064 R   8.2   5.2   0:08.43 Xorg                                                     
  990 root      20   0       0      0      0 D   5.7   0.0   0:07.57 usb-storage                                              
  623 root      20   0   14560   7440   6888 S   1.9   0.8   0:03.22 vncagent                                                 
 1166 root      20   0       0      0      0 D   1.9   0.0   0:01.81 md1_resync                                               
 1181 pi        20   0   10520   3132   2600 R   1.9   0.3   0:00.44 top                                                      
   75 root       0 -20       0      0      0 I   1.3   0.0   0:00.76 kworker/3:1H-kblockd                                     
  940 pi        20   0   98592  11060   9776 R   1.3   1.2   0:02.68 gvfs-udisks2-vo                                          
 1056 root      20   0       0      0      0 D   1.3   0.0   0:01.24 md1_raid1                                                
    1 root      20   0   33676   8064   6440 S   0.6   0.9   0:03.87 systemd                                                  
   10 root      20   0       0      0      0 R   0.6   0.0   0:00.41 rcu_sched                                                
   74 root       0 -20       0      0      0 I   0.6   0.0   0:00.90 kworker/0:1H-kblockd                                     
   84 root       0 -20       0      0      0 I   0.6   0.0   0:00.97 kworker/1:1H-kblockd                                     
  372 root      20   0   12996   5772   5140 S   0.6   0.6   0:00.22 systemd-logind
iostat

Code: Select all

Device            r/s     w/s     rkB/s     wkB/s   rrqm/s   wrqm/s  %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util
mmcblk0          0.00    0.00      0.00      0.00     0.00     0.00   0.00   0.00    0.00    0.00   0.00     0.00     0.00   0.00   0.00
sda            230.00    2.00  14720.00      4.50     0.00     0.00   0.00   0.00    8.58    9.50   0.97    64.00     2.25   4.18  97.00
sdb              0.00  217.00      0.00  13764.50     0.00     0.00   0.00   0.00    0.00    8.29   0.87     0.00    63.43   4.01  87.00
md1              0.00    0.00      0.00      0.00     0.00     0.00   0.00   0.00    0.00    0.00   0.00     0.00     0.00   0.00   0.00

BespokeTech
Posts: 71
Joined: Thu Apr 04, 2019 8:14 pm

Re: about cpu usage rate and hard disk usage rate after set Raid 1

Fri Jul 12, 2019 8:29 pm

I would fully expect dismal performance. The usb ports and ethernet are all connected to a single controller on the SOC, you only have 1gb of ram and using software raid.

I may be wrong because I have never tried, but I would think your idea is a non starter, well with any kind of acceptable performance anyway.

LTolledo
Posts: 1950
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: about cpu usage rate and hard disk usage rate after set Raid 1

Sat Jul 13, 2019 3:21 am

I've tried RAID1 before on the RPi3B and 2 x 16GB thumbdrives

took hours to build the RAID
once it was completed, it takes almost the same amount of time to re-sync the RAID.

then after a few days, the RAID was not functioning at all. the RAID got "destroyed"
good thing only test data was written on the drives.

abandoned the idea of doing RAID

now am using timed mirroring of two drives using rsync and cron
works better and easier to manage.

and I can do it across the network as well (timed mirroring of HDD1 in RPi2BNAS1 to HDD1 in RPi2BNAS2)

...but hey... you're still free to do what you like...
as far as I can remember the CPU usage on the RAID1 setup was not over 10% (as seen via htop)
didn't check the usage rate
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “Beginners”