본문 바로가기

CLOUD

[Azure] 디스크 RAID 0과 IOPS 상관관계

# VM Sku
Standard_F8s_v2 / Linux (Ubuntu 20.04) > 12,800 IOPS
# Disk Sku
P30 > 1024GiB (5,000 IOPS)
P40 > 2048GiB (7,500 IOPS)

### VM 연결 후
fdisk -l
fdisk /dev/sdc >파티션 생성 n >타입 변경 t >fd "Linux raid autodetect" >저장 w
fdisk /dev/sdd >파티션 생성 n >타입 변경 t >fd "Linux raid autodetect" >저장 w
### RAID 0
mdadm --create /dev/md127 --level 0 --raid-devices 2 /dev/sdc1 /dev/sdd1
mkfs -t ext4 /dev/md127
mkdir /raidtest
mount /dev/md127 /raidtest
df -h

 

mdadm --detail /dev/md127

 

fallocate -l 12876513280 test.txt >/dev/md127와 똑같은 바이트 크기의 파일 생성

mv test.txt /raidtest

100% 사용됨..

 

 

mdadm의 RAID 0은 크기가 다른 디스크를 지원한다?

linux - mdadm raid0 with disks of different size? - Unix & Linux Stack Exchange

 

mdadm raid0 with disks of different size?

Currently I'm using LVM just to merge a few disks of different size. I want to know if it is possible to use mdadm with stripes instead of LVM? Will it give me additional performance? Will it ...

unix.stackexchange.com

 

똑같은 문제 겪은 사람 발견

mdadm - How does RAID0 work underneath, when the devices have different sizes? - Unix & Linux Stack Exchange

 

How does RAID0 work underneath, when the devices have different sizes?

To my surprise the CentOS 7 installer allowed me to create a RAID0 device consisting of roughly a 17 GB disk and a 26 GB disk. I would've expected that even if it allows that, that the logical size...

unix.stackexchange.com

답변1)

디바이스 크기가 같아야 하지만 반드시 그럴 필요는 없음

한 디바이스가 다른 디바이스보다 큰 경우 추가 공간은 RAID에서 계속 사용되지만 크기가 큰 디스크에만 액세스하게 되므로 성능이 저하됨

답변2)

총 4+8=12GiB 사용 가능함

4*2=8GiB를 사용할 때는 단일 디스크의 2배 성능이지만 12-8=4GiB를 사용할 때는 단일 디스크 성능과 동일함

What is RAID and why should you want it? - Linux Raid Wiki (kernel.org)

 

What is RAID and why should you want it? - Linux Raid Wiki

What is(n't) RAID RAID stands for either Redundant Array of Independent Disks, or Redundant Array of Inexpensive Disks, depending on who you talk to. The general consensus is that "Independent" came first, and "Inexpensive" followed. The intention of RAID

raid.wiki.kernel.org

  • The devices should (but don't HAVE to) be the same size. Operations on the array will be split on the devices; for example, a large write could be split up as 64 kiB to disk 0, 64 kiB to disk 1, 64 kiB to disk 2, then 64 kiB to disk 0 again, and so on. Writes to each disk will go on at the same time. If one device is much larger than the other devices, that extra space is still utilized in the RAID device, but you will be accessing this larger disk alone, during writes in the high end of your RAID device. This of course hurts performance.

mdadm - Wikipedia

 

mdadm - Wikipedia

From Wikipedia, the free encyclopedia Linux utility for managing software RAID mdadm is a Linux utility used to manage and monitor software RAID devices. It is used in modern Linux distributions in place of older software RAID utilities such as raidtools2

en.wikipedia.org

  • RAID 0 – Block-level striping. MD can handle devices of different lengths, the extra space on the larger device is then not striped.

 

그렇다면 2TiB 크기의 파일을 넣은 후 Fio 파일 테스트 실행해보자!

apt-get update

apt-get install -y fio

 

fio --directory=/raidtest --name fio_read --direct=1 --rw=read --bs=8K --size=1G --numjobs=16 --time_based --runtime=60 --group_reporting --norandommap

P40의 IOPS로 제한된 것을 확인!