stat 시리즈의 완결판, dstat?

1.
리눅스 시스템을 모니터링할 때 사용하는 명령어들이 있습니다. 어떤 것들이 있을까요? Linux를 도입하면 성능관리는 어떻게?에서 소개하였던 시스템 성능과 관련한 전문가인 Brendan Greig가 쓴 Linux Performance Analysis and Tools에 있는 그림입니다.

linus_stat

pidstat, vmstat, mpstat,iostat…등 영어로 상태를 표현하는 State를 접미사로 가진 명령어들입니다. 명령어를 사용하는 방법은 statコマンドの基本的な使い方를 참고로 하시고 각 명령어들을 잘 활용하면 리눅스 시스템을 잘 다룰 수 있습니다. 아래 파일을 꼼꼼히 읽어보시면 도움이 될 듯 합니다.

Download (PDF, 2.6MB)

2.
앞서 명령어중 dstat가 있습니다. 저는 처음 본 명령어입니다. 검색을 하다 우연히 접한 명령어입니다. 개발자가 소개하는 dstat는 이렇습니다.

Dstat is a versatile replacement for vmstat, iostat, netstat and ifstat. Dstat overcomes some of their limitations and adds some extra features, more counters and flexibility. Dstat is handy for monitoring systems during performance tuning tests, benchmarks or troubleshooting.

Dstat allows you to view all of your system resources in real-time, you can eg. compare disk utilization in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).

개발자의 표현대로 versatile, 다재다능한 대체재입니다. dstat의 장점은 하나의 명령어로 거의 모든 부분을 모니터링할 수 있다는 점입니다. 자체적으로 모티터링이 가능한 자원들입니다.

aio, cpu, cpu24, disk, disk24, disk24old, epoch, fs, int, int24, io, ipc, load, lock, mem, net, page, page24, proc, raw, socket, swap, swapold, sys, tcp, time, udp, unix, vm

또다른 장점은 플러그인입니다. python으로 개발된 플러그인으로 모니터링영역을 확장할 수 있습니다. 현재 개발공급중인 플러그인들입니다. MySQL을 지원하고 자원을 기준으로 상위의 프로세스를 확인할 수도 있습니다.

battery, battery-remain, cpufreq, dbus, disk-recsize, disk-tps, disk-util, dstat, dstat-cpu, dstat-ctxt, dstat-mem, fan, freespace, gpfs, gpfs-ops, helloworld,innodb-buffer, innodb-io, innodb-ops, lustre, mem-adv, memcache-hits, mysql-io, mysql-keys, mysql5-cmds, mysql5-conn, mysql5-io, mysql5-keys, net-packets, nfs3, nfs3-ops, nfsd3, nfsd3-ops, ntp, pcap-ssh, postfix, power, proc-count, proc-count2, proc-count3, qmail, rpc, rpcd, sendmail, snooze, squid, test, thermal, top-bio, top-bio-adv, top-childwait, top-cpu, top-cpu-adv, top-cpu2, top-cpu3, top-cputime, top-cputime-avg, top-int, top-io, top-io-adv, top-latency, top-latency-avg, top-mem, top-oom, top-tcp-ports, utmp, vm-memctl, vmk-hba, vmk-int, vmk-nic, vz-cpu, vz-io, vz-ubc, wifi

dstat 버전과 설치된 플러그인에 따라 지원하는 기능이 다르기때문에 아래와 같이 -V 을 주면 지원하는 기능을 확인할 수 있습니다.

마지막으로 csv로 결과값을 바꿀 수 있습니다. 예를 들어 일반 텍스트파일로 결과를 얻고자 하면 아래와 같습니다.

똑같은 결과를 csv로 얻고자 하면 –output 옵션을 사용합니다.

csv 파일은아래와 같은 형식으로 이루어집니다.

이제 dstat가 어떻게 데이타를 보여주는지를 아래으로 확인해보세요.

dstat

텍스트라 불편한가요? rsyslog와 fluentd에서 소개한 Fluentd 를 이용하면 아래와 같은 모니터링도구를 만들 수 있습니다. 물론 다양한 방법이 가능합니다.

kibana

dstat와 관련한 정보는 아래에서 확인하실 수 있습니다.

Dstat: Versatile resource statistics tool

1 Comment

  1. ms

    감사합니다

    Reply

Leave a Comment

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.