티스토리 뷰

System Story/CentOS 5,6

Linux Disk 성능 측정

helperchoi 2015. 7. 14. 10:58

Linux 서버이하 FC-SAN, iSCSI, NAS등 별도의 Storage를 구성하여 이용할 경우 Storage Vendor에서 제공하는 성능 모니터 Tool등을 이용하여 Storage의 전체처리 IOPS나 Disk 응답 Latency 정보등을 얻을 수 있다.

 

만약 Storage 에서 특정 LUN 및 Volume 단위의 성능정보를 얻을 수 없다면, Linux OS 에서 제공하는 아래와 같은 방법으로 Disk의 Read/Write 속도를 측정 가능하다.

 

 

1. 특정 Volume에 대한 Disk Read Ahead Cache Size 확인

 

[root@TEST_DB1-NEW ~]#
[root@TEST_DB1-NEW ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda2             20G  3.1G   16G  17% /
/dev/xvda6             20G  3.6G   15G  20% /usr
/dev/xvda5             20G  3.8G   15G  21% /var
/dev/xvda3             30G   16G   13G  57% /home
/dev/xvda1            996M   41M  904M   5% /boot
tmpfs                  31G     0   31G   0% /dev/shm
/dev/xvdb1             99G   63G   31G  68% /APP
/dev/dm-0             788G  540G  208G  73% /Data
[root@TEST_DB1-NEW ~]#
[root@TEST_DB1-NEW ~]#
[root@TEST_DB1-NEW ~]# blockdev --report /dev/dm-0
RO    RA   SSZ   BSZ   StartSec     Size    Device
rw   256   512  4096          0 1677721600  /dev/dm-0
[root@TEST_DB1-NEW ~]#

[root@TEST_DB1-NEW ~]#
[root@TEST_DB1-NEW ~]#

 

- 확인된 Disk Cache 설정값(RA * SSZ / 1024) : 128KB
- 계산식 : (256 * 512)  / 1024 = 128 KB
- Hitachi AMS2500 Storage Controler 제공하는 Disk Cache 16GB 내에서 조정 예시
- 128MB 기준 변경 : (128 * 1024 * 1024) / 512 = 262144


blockdev --setra 262144 /dev/dm-0

 

 

2. Disk Write 성능측정

 

[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# dd if=/dev/zero of=/Data/load_test.img bs=512k count=2000 oflag=direct; sync;

2000+0 records in
2000+0 records out
1048576000 bytes (1.0 GB) copied, 1.23153 seconds, 851 MB/s
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# dd if=/dev/zero of=/Data/load_test.img bs=512k count=2000 oflag=direct; sync;

2000+0 records in
2000+0 records out
1048576000 bytes (1.0 GB) copied, 1.2783 seconds, 820 MB/s
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# dd if=/dev/zero of=/Data/load_test.img bs=512k count=2000 oflag=direct; sync;

2000+0 records in
2000+0 records out
1048576000 bytes (1.0 GB) copied, 1.22622 seconds, 855 MB/s
[root@TEST_DB1 ~]#

 

 

3. 순차 읽기(Sequential Access Read) 성능 측정

 

[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# dd if=/Data/load_test.img of=/dev/null
2048000+0 records in
2048000+0 records out
1048576000 bytes (1.0 GB) copied, 3.89702 seconds, 269 MB/s
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# dd if=/Data/load_test.img of=/dev/null
2048000+0 records in
2048000+0 records out
1048576000 bytes (1.0 GB) copied, 4.31475 seconds, 243 MB/s
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# dd if=/Data/load_test.img of=/dev/null
2048000+0 records in
2048000+0 records out
1048576000 bytes (1.0 GB) copied, 3.82925 seconds, 274 MB/s
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]#

 

 

4. Random Access Read 성능 측정

 

[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# hdparm -t /dev/dm-0

/dev/dm-0:
Timing buffered disk reads:  318 MB in  3.00 seconds = 105.97 MB/sec
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# hdparm -t /dev/dm-0

/dev/dm-0:
Timing buffered disk reads:  332 MB in  3.00 seconds = 110.59 MB/sec
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]#
[root@TEST_DB1 ~]# hdparm -t /dev/dm-0

/dev/dm-0:
Timing buffered disk reads:  336 MB in  3.02 seconds = 111.25 MB/sec
[root@TEST_DB1 ~]#

 

 

 

 

반응형
반응형
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday