반응형
시스템을 구성하고 시스템의 IO 상황이 어떤지 확인할 필요가 있습니다. 특히, DBMS와 같이 IO에 의존하는 시스템은 반드시!!! 시스템의 IO 현황을 확인해야 합니다. IO 현황을 확인할 때 사용하는 iostat의 출력값을 해석하는 방법을 서술해 봅니다.
아래의 예와 초록색 표시한 부분을 따라서 읽어보면 됩니다. 그리고 일반적인 해결 방법도 제일 아래에 붙입니다.
%util은 현재 응용 프로그램이 얼마나 I/O에 연관된 것인가를 보여주는 지표입니다. 아래 식으로 계산합니다.
%util = ((Write operation 개수 + Read operation 개수) * 평균 처리 시간) / 측정 interval
예:
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
dm-0 0.00 0.00 611.40 414.23 20286.60 1656.93 42.79 17.50 17.33 0.96 98.57
- Device: the block device whose performance counters are being reported
- r/s and w/s: number of read and write requests issued per second to the device (in this case 611 and 414)
- rsec/s and wsec/s – number of sectors read/written per second
- rkB/s and wkB/s – number of kilobytes read/written per second
- avgrq-sz – average number of sectors per request (for both reads and writes). ie (rsec + wsec) / (r + w)
- avgqu-sz – average queue length in the monitoring interval (in this case 42.79)
- await – average time that each IO Request took to complete. This includes the time that the request was waiting in the queue and the time that the request took to be serviced by the device
- svctim – average time each IO request took to complete during the monitoring interval
- Note: await includes svctim. Infact await (average time taken for each IO Request to complete) = the average time that each request was in queue (lets call it queuetime) PLUS the average time each request took to process (svctim)
- %util: This number depicts the percentage of time that the device spent in servicing requests. This can be calculated with the above values. In the above example the total number of reads and writes issued per second is 611 + 414 => 1025. Each request takes 0.96 ms to process. Therefore 1025 requests would take 1025 x 0.96 => 984 ms to process. So out of the 1 second that these requests were sent to the device in, 984 ms were taken to process the requests. This means the device utilization is 984/1000 * 100 => ~98.4%. As you can see in the above iostat output the %util does show ~ 98.5%
일반적으로 %util이 80%를 넘으면 문제를 해결하는 방법은 아래와 같습니다.
- increasing RAM so dependence on disk reduces
- increasing RAID controller cache so disk dependence decreases
- increasing number of disks so disk throughput increases (more spindles working parallely)
- horizontal partitioning
- [출처] iostat의 %util 계산하는 방법|작성자 정일동
http://blog.naver.com/idjung/150082332311
반응형
'연구개발 > MYSQL' 카테고리의 다른 글
Table / Column Comment 추출하는 쿼리 (0) | 2014.12.16 |
---|---|
InnoDB tablespace 구조 (0) | 2014.12.16 |
파티션 삭제시 Exchange Partition 기능 활용 (0) | 2014.12.11 |
SHOW PROCESSLIST (0) | 2014.12.11 |
MySQL 5.5 Semisynchronous Replication v1.0 (0) | 2014.12.10 |