詳細検索

Amazon EBS에서 RAID0를 설정할 때 성능 검증

아바타
글쓴이 komi

Amazon EBS에서 RAID0를 설정할 때 성능 검증
日本語에서 번역 • 원문 보기

Amazon EBS에서 RAID0를 설정할 때 성능 검증

가능한 한 빨리 BES가 형성되었는지 확인하고 싶습니다.

테스트에서 멀티 또는 클로지가 될 경우 이런 현상이 꽤 사실이라는 이론이 있는 것 같습니다.
또한 기존 디렉터리로의 마이그레이션 방법(예: 이진 로그와 같은 디렉터리 분리부터 시작)도 고려할 것입니다. )

공식 사용자 가이드 (EBSPerformance)
EBS 자체는 중복 구성을 가지고 있어서 RAID0가 좋은 것 같습니다.

인스턴스 디스크(로컬 디스크, 임시 디스크)를 사용하여 RAID0와 함께 RAID0를 구축하는 것은 대형 인스턴스 이상에서 두 개의 디스크 사용 시 디스크 I/O 성능이 크게 향상되었으며, 이는 RAID10(미러 스트라이프)과 동등합니다

일시적인 디스크(멈추면 사라지는 디스크)에서 raid0를 실행하고 싶을 때 부팅 명령의 예시입니다.
[shell] ec2-run-instances ami-e965ba80 --region us-east-1 --키 ID_rsa --Group SG-A4866fcc --Placement-Group test --instance-type cc2.8xlarge -b "/dev/sdb=ephemeral0" - b "/dev/sdc=ephemeral1" -b "/dev/sdd=ephemeral2" "/dev/sdf=ephemeral3" [/shell] - Large Software에 EBS 디스크 두 개를 추가하고 부팅 및 로그인
[shell] # df -h 파일 시스템 크기 사용 가능 사용 % /dev/xvde1에 마운트 9.9G 867M 8.5G 10% /none 3.7G 0 3.7G 0% /dev/shm # ls -l /dev/xv* brw-rw---- 1 루트 디스크 202, 3월 21일 65일 02:15 /dev/xvde1 brw-rw---- 1 root 디스크 202, 80 02:15 /dev/xvdf brw-rw---- 1 root 디스크 202, 3월 21일 96일 02:15 /dev/xvdg 찾아 /dev -type b -print [/shell] 시도해봤지만, 위 이름이 그런 소리로 들리는 유일한 것이네요.

・MDADM으로 RAID 형성
MDADM 사용 방법
[shell] # yum install mdadm 설치: mdadm.x86_64 0:3.2.5-4.el6 # /sbin/mdadm --create /dev/md0 --level=0 -c256 --raid-devices=2 /dev/xvdf /dev/xvdg mdadm: 기본값으로 버전 1.2 mdadm: 배열 /dev/md0 시작. # 에코 'DEVICE /dev/xvdf /dev/xvdg' > /etc/mdadm.conf # mdadm --detail --scan>> /etc/mdadm.conf # cat /etc/mdadm.conf DEVICE /dev/xvdf /dev/xvdg 배열 /dev/md0 메타데이터=1.2 이름=aws-cent63-template:0 UUID=f1d24aee:f788f00e:66d66f4d:ac63fa92 # ls -l /dev/md0 brw-rw---- 1 루트 디스크 9, 0 2월 21일 02:39 /dev/md0 [/shell]
XFS가 빠르다고 하긴 했지만, 이번 벤치 결과를 보면 실제로 크게 변하지 않을 수도 있겠네요.

또한 XFS가 ACL을 사용할 때 실제로 느린다는 정보도 있었습니다.
(SSD와 iodrive는 xfs로 4kb로 빠르게 포맷된다고 들었습니다.)

그래서 같은 파일 시스템으로, 평범하게 시도해보기로 했습니다.
[shell] # 마운트 /dev/xvde1 on / type ext4 (rw) nonone /proc type proc (rw) nonone /sys type sysfs (rw) nonone /dev/pts type devpts (rw,gid=5,mode=620) non /dev/shm type tmpfs (rw) nonone type tmpfs (rw) nonone /proc/sys/fs/binfmt_misc type binfmt_misc (rw) # mkfs.ext4 /dev/md0 # mkdir /data # 마운트 /dev/md0 /data # df -h 파일 시스템 크기 사용 가능 /dev/xvde1 9에 마운트된 사용 가능 6G 9% / 없음 3.7G 0 3.7G 0% /dev/shm /dev/md0 20G 172M 19G 1% /data # 마운트 /dev/xvde1 on / type ext4 (rw) 없음 /proc type proc (rw) 없음 /sys type sysfs (rw) /dev/pts 유형 devpts (rw,gid=5,mode=620) /dev/shm 유형 tmpfs (rw, gid=5, mode=620) 없음 /proc/sys/fs/binfmt_misc none binfmt_misc (rw) /dev/md0 on /data type ext4 (rw) [/shell] ·벤치마크
FIO 벤치 참조
FIO 다운로드
[shell] # wget http://pkgs.repoforge.org/fio/fio-2.0.9-1.el6.rf.x86\_64.rpm # yum install libaio # rpm -ivh fio-2.0.9-1.el6.rf.x86_64.rpm [/shell] 4K 무작위 읽기를 16개의 다중화로 5번 측정합니다.
[shell] # vi randread4k16.fio # cat randread4k16.fio [randread4k] readwrite=randread, 블록 크기=4k 크기=100m 디렉터리=/data direct=1 loops=5 numjobs=16 # fio -group_reporting randread4k16.fio 생략 읽기 : io=512000KB, bw=3200.6KB/s, IOPS=800, runt=159974msec 생략


실행 상태 그룹 0 (모든 작업): READ: io=8000.0MB, aggrb=51001KB/s, minb=3187KB/s, maxb=3209KB/s, mint=159540msec, maxt=160623msec 디스크 통계(읽기/쓰기): md0: ios=2047724/11, merge=0/0, ticks=0/0, in_queue=0, util=0. 00%, aggrios=1024000/4, aggrmerge=0/1, aggrticks=1203285/363, aggrin_queue=1202916, aggrutil=87. 91% xvdf: ios=1024000/9, merge=0/2, ticks=1177359/726, in_queue=1177346, util=82.95% xvdg: ios=1024000/0, merge=0/0, ticks=1229211/0, in_queue=1228486, util=87.91% [/shell] 4K 무작위 빛은 16개의 다중화로 5번 측정됩니다.
[shell] # vi randwrite4k16.fio [randwrite4k] readwrite=randwrite blocksize=4k size=100m directory=/data direct=1 loops=5 numjobs=16 # fio -group_reporting randwrite4k16.fio omitted write: io=512000KB, bw=1997.4KB/s, iOPS=499 , runt=256336msec omitted
실행 상태 그룹 0 (모든 작업): WRITE: io=8000.0MB, aggrb=31902KB/s, minb=1993KB/s, maxb=1998KB/s, mint=256247msec, maxt=256786msec 디스크 통계(읽기/쓰기): md0: ios=0/2061004, merge=0/0, ticks=0/0, in_queue=0, util=0. 00%, aggrios=0/1024965, aggrmerge=0/5568, aggrticks=0/2042634, aggrin_queue=2042035, aggrutil=99. 58% xvdf: ios=0/1025035, merge=0/5770, ticks=0/1733675, in_queue=1733059, util=97.23% xvdg: ios=0/1024895, merge=0/5366, ticks=0/2351593, in_queue=2351011, util=99.58% [/shell] 순차적 값을 측정해 보세요
[shell] # vi seqread4k16.fio [seqread4k] readwrite=read blocksize=4k size=100m directory=/data direct=1 loops=5 numjobs=16 # fio -group_reporting seqread4k16.fio omitted read : io=512000KB, bw=3215.9KB/s, iOPS=803 , runt=159213msec omitted
실행 상태 그룹 0 (모든 작업): READ: io=8000.0MB, aggrb=51306KB/s, minb=3206KB/s, maxb=3216KB/s, mint=159165msec, maxt=159669msec 디스크 통계(읽기/쓰기): md0: ios=2046486/24, merge=0/0, ticks=0/0, in_queue=0, util=0. 00%, aggrios=1024000/5, aggrmerge=0/6, aggrticks=1202445/327, aggrin_queue=1202016, aggrutil=87. 41% xvdf: iOS=1024000/11, merge=0/13, ticks=1183413/655, in_queue=1183332, util=84.11% xvdg: ios=1024000/0, merge=0/0, ticks=1221478/0, in_queue=1220701, util=87.41% # vi seqwrite4k16.fio [seqwrite4k] readwrite=write blocksize=4k size=100m directory=/data direct=1 loops=5 numjobs=16 # fio -group_reporting seqwrite4k16. fio omitted write: io=512000KB, bw=1795.7KB/s, iops=448, runt=285131msec 생략 실행 상태 그룹 0 (모든 작업): WRITE: io=8000.0MB, aggrb=28708KB/s, minb=1794KB/s, maxb=1797KB/s, mint=284902msec, maxt=285354msec 디스크 통계(읽기/쓰기): md0: ios=0/2048172, merge=0/0, ticks=0/0, in_queue=0, util=0/0 .00%, aggrios=0 /1024126, aggrmerge=0/5, aggrticks=0/2263010, aggrin_queue=2262748, aggrutil=96.45% xvdf: ios=0/1024125, merge=0/11, ticks=0/2035946, in_queue=2035696, util=91.73% xvdg: ios=0/1024128, merge=0/0, ticks=0/2490074, in_queue=2489800, util=96.45% [/shell] 차이를 RAID0가 아닌 경우에도 측정하세요
[shell] # vi randread4k16_noraid.fio [randread4k] readwrite=randread blocksize=4k size=100m directory=/ direct=1 loops=5 numjobs=16 # fio -group_reporting randread4k16_noraid.fio ~略~ read : io=512000KB, bw=3194.4KB/s, iops=798 , runt=160281msec ~略~ Run status group 0 (all jobs): READ: io=8000.0MB, aggrb=50913KB/s, minb=3182KB/s, maxb=3200KB/s, mint=159959msec, maxt=160899msec Disk stats (read/write): xvde1: ios=2047511/20, merge=0/5, ticks=2427396/202, in_queue=2426053, util=100.00% # vi randwrite4k16_noraid.fio [randwrite4k] readwrite=randwrite blocksize=4k size=100m directory=/ direct=1 loops=5 numjobs=16 # fio -group_reporting randwrite4k16_noraid.fio ~略~ write: io=512000KB, bw=1374.4KB/s, iops=343 , runt=372625msec ~略~ Run status group 0 (all jobs): WRITE: io=8000.0MB, aggrb=21969KB/s, minb=1373KB/s, maxb=1375KB/s, mint=372306msec, maxt=372874msec Disk stats (read/write): xvde1: ios=1/2049664, merge=0/14975, ticks=7/5995555, in_queue=5995341, util=100.00% # vi seqread4k16_noraid.fio [seqread4k] readwrite=read blocksize=4k size=100m directory=/ direct=1 loops=5 numjobs=16 # fio -group_reporting seqread4k16_noraid.fio ~略~ read : io=512000KB, bw=3124.3KB/s, iops=781 , runt=163882msec ~略~ Run status group 0 (all jobs): READ: io=8000.0MB, aggrb=49945KB/s, minb=3121KB/s, maxb=3129KB/s, mint=163601msec, maxt=164020msec Disk stats (read/write): xvde1: ios=2046743/23, merge=0/3, ticks=2503841/252, in_queue=2502405, util=100.00% # vi seqwrite4k16_noraid.fio [seqwrite4k] readwrite=write blocksize=4k size=100m directory=/ direct=1 loops=5 numjobs=16 # fio -group_reporting seqwrite4k16_noraid.fio ~略~ write: io=512000KB, bw=1438.6KB/s, iops=359 , runt=355910msec ~略~ Run status group 0 (all jobs): WRITE: io=8000.0MB, aggrb=23015KB/s, minb=1438KB/s, maxb=1439KB/s, mint=355585msec, maxt=355936msec Disk stats (read/write): xvde1: ios=15/2047985, merge=0/21, ticks=65/5674427, in_queue=5674447, util=100.00% [/shell] ★比較結果

읽기/쓰기 타입,싱글디스크(IOPS),raid0disk(iOPS),싱글디스크(대역폭),Raid0disk (대역폭)
무작위 단서7988003194.4KB/s3200.6KB/s
랜덤 라이트3434991374.4KB/s1997.4KB/s
순차적 리드7818033124.3KB/s3215.9KB/s
순차적 빛3594481438.6KB/s1795.7KB/s
결과: 레이드 0을 설정하는 것이 더 빠릅니다. (※)
*이 결과는 이 환경에서 발생하므로, 실제로 사용 중인 환경에서 시도해 보시길 권장합니다.

·제안된 이동 방법

백업용으로 동기화된 서버의 포트 3307에 있는 DB가 당분간 마이그레이션 대상입니다.
테스트 환경도 혼합되어 있기 때문에, IO가 분산되면 지연 시간에 대해 꽤 효과적일 것 같습니다.

  1. 대상 서버에 디스크를 추가하고, raid0로 설정한 후 포맷합니다.
  2. 슬레이브 중지 (가능하면 my.cnf로 건너뛰needed_slave
  3. mysql2 (3307) 중지
  4. 데이터 디렉터리 복사
  5. 상징적 연결
  6. mysql2 실행
  7. 필요 시 노예 시작
  8. 동기화될 때까지 기다립니다
  9. 지연 정도 확인

이미지를 덤프하고 복원하는 방법이 특별했던 것 같아서, 차가운 상태가 필요 없으면 좋겠다고 생각해요.

Related Articles