리눅스에서 디스크 성능 측정 방법

리눅스 운영체제 환경에서 디스크 성능 측정 방법

작성자 : 서진우

작성일 : 2005년 8월 10일

1. hdparm 을 이용한 기본 Read buffer 성능 과 Read cache 성능 측정

 
[root@skt00 ~]# hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads:  654 MB in  3.00 seconds = 217.97 MB/sec

[root@skt00 ~]# hdparm -T /dev/sda

/dev/sda:
 Timing cached reads:   11852 MB in  2.00 seconds = 5932.62 MB/sec

2. bonnie 를 이용한 디스크 측정

#  bonnie++ -u root -d /usr/local/src -s 2000 -x 1 -r 1000 | bon_csv2txt > raid-3ware.txt

——————————————————————————————
Version  1.03      ——Sequential Output—— –Sequential Input- –Random-
                    -Per Chr- –Block– -Rewrite- -Per Chr- –Block– –Seeks–
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
skt00         2000M 58415  97 372728  87 397921  46 67869  98 2466795 100 +++++ +++
                    ——Sequential Create—— ——–Random Create——–
                    -Create– –Read— -Delete– -Create– –Read— -Delete–
files:max:min        /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
skt00            16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
——————————————————————————————

-d : 임시 파일 생성 위치
-s : 임시 파일 크기 ( 단위 MB )
-x : 동시 작업자 수
-r : 테스트 시 사용할 메모리 수  ( 파일 크기의 절반 )

3. Iozone 을 이용한 디스크 성능 측정

자동 모드 테스트 방법

# /opt/iozone/bin/iozone -Ra -g 2G -i 0 -i 1 -i 2 -b 3ware-iozone.xls

-b : 결과를 엑셀 파일로 생성
-a : 모든 테스트를 auto 모드로 ..
-g : 테스트 시 생성할 최대 파일 크기
-i : 테스트 종료
 0 : read/reread
 1 : write/rewrite
 2 : rendom read/write

수동 모드 테스트 방법

# /opt/iozone/bin/iozone -i 0 -i 1 -i 2 -s 100M -t 100

-s 테스트 파일 크기
-t 동시 작업 수

/opt/iozone/bin/iozone -s 2g -r 256k -p -i 0 -i 1 -t 4 -b ibrix-2G-local-home-4proc.xls -F /home/iozone1 /home/iozone2 /home/iozone3 /home/iozone4

클러스터 파일 테스트

# iozone -s 2g -r 4k -peo -t nproc -+m client_list

-r : block size
-p : Purge on
-e : Include flush (fsync,fflush) in the timing calculations
-o : Writes are synch (O_SYNC)

– client_list 파일 표기 방식
lustre00 /home /opt/iozone/bin/iozone
<clientname> <iozone 테스트 경로> <iozone 실행파일경로>

# /opt/iozone/bin/iozone -s 2g -r 256k -i 0 -i 1 -t 16 -b /root/ibrixbmt/ibrix-2G-nfs-home-16cluster.xls -+m /root/ibrixbmt/home_list

# 일반 파일 테스트

# iozone -s 100M -Ra

# read cache 영향 안 받게 ..

/opt/iozone/bin/iozone -s 2g -r 256k -p -i 0 -i 1 -U /mnt -b result.xls -f /mnt/iozone0

# 멀티쓰레드 환경으로 테스트하기

 /opt/iozone/bin/iozone -R -l 2 -u 5 -r 1m -s 100m -F /home/f1 /home/f2 /home/f3 /home/f4 /home/f5

-l  : 최소 쓰레드 시작 수

-u : 최대 쓰레드 수

# iozone 콘솔 로그 저장 하기

 /opt/iozone/bin/iozone -R -l 5 -u 5 -r 1m -s 100m -F /home/f1 /home/f2 /home/f3 /home/f4 /home/f5 | tee -a /tmp/iozone_results.txt &

-b 옵션을 통해 엑셀 파일로 저장할수도 있지만, 엑셀 파일의 경우 최종 결과 중심으로 결과가

저장된다. 중간 결과값들까지 상세하게 분석이 필요한 경우 콘솔에 올라오는 모든 로그가 필요

하게 되는데, 이때 tee 명령을 이용하여 로그를 저장한다.  

# generate_graphs 를 이용한 그래프 생성방법

generate_graphs 스크립트를 vi로 열어 gengnuplot.sh 와 gnu3d.dem 파일 경로를 절대경로로

변경해 준다.

————————————————————————————

# YOU MUST PROVIDE A FILE NAME FOR IT TO PROCESS.

# This filename is the name of the file where you

# sent Iozone’s output.

# ————————————————

# Generate data base for all of the operation types.

/opt/iozone/bin/gengnuplot.sh $1 write

/opt/iozone/bin/gengnuplot.sh $1 rewrite

/opt/iozone/bin/gengnuplot.sh $1 read

/opt/iozone/bin/gengnuplot.sh $1 reread

/opt/iozone/bin/gengnuplot.sh $1 randread

/opt/iozone/bin/gengnuplot.sh $1 randwrite

/opt/iozone/bin/gengnuplot.sh $1 bkwdread

/opt/iozone/bin/gengnuplot.sh $1 recrewrite

/opt/iozone/bin/gengnuplot.sh $1 strideread

/opt/iozone/bin/gengnuplot.sh $1 fwrite

/opt/iozone/bin/gengnuplot.sh $1 frewrite

/opt/iozone/bin/gengnuplot.sh $1 fread

/opt/iozone/bin/gengnuplot.sh $1 freread

# Produce graphs and postscript results.

gnuplot /opt/iozone/bin/gnu3d.dem

——————————————————————————-

/opt/iozone/bin/iozone -a -g 100m > iozone_results.txt  

/opt/iozone/bin/Generate_Graphs iozone_results.txt

4. dd 를 이용한 디스크 성능 테스트 측정

 dd if=/dev/zero of=<bigfile> bs=1M count=10
설명 : dd 명령으로 bigfile 이라는 10M가 파일을 생성.

count값을 늘려주면 파일사이즈 증가됨

예를 들어 count 값이 20이 되면 block size 1M의 20Mbyte 파일이 생성됨

& 추가사항
ftp 로 가상 파일 전송 테스트
1. 우선 해당 ftp 서버로 접속
2. put “|dd if=/dev/zero bs=1024k count=1000” /dev/null
설명 : ftp 접속 상태상에서 1G 가의 파일을 보냄(가상)
        실제파일 전송은 안됩니다.

dd 로 파일 읽기 테스트

dd if={filename or device} of=/dev/null — 나머지는 동일함.

읽기를 할때는 of를 /dev/null로 해 주세요.

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

2 Responses

  1. 2022년 6월 18일

    1reservations

  2. 2023년 1월 27일

    2awe-inspiring

페이스북/트위트/구글 계정으로 댓글 가능합니다.