Professional Documents
Culture Documents
Logging System Resources With Dstat: Apt-Get Install Dstat
Logging System Resources With Dstat: Apt-Get Install Dstat
Logging System Resources With Dstat: Apt-Get Install Dstat
Dstat allows you to see all system resources and compare them against each other, this is very useful for seeing what is happening to the resources on a server, if a particular resource has run out for example it can cause performance problems. To use dstat you will first need to install it, if you do not already have it.
apt-get install dstat
This is essentially running dstat with -cdngy as this is what happens by default when you run dstat alone. This will output information for each variable to the screen every second. There are a lot of things you can monitor with dstat, you can check all these out on the man page which is definitely worth a look at.
dstat -tcdrgilmns --output /var/log/dstat.csv --noupdate 5
-t Time ! enables timestamps on the logs, very useful when logging at logs later -c "#$ stats %system, user, idle, wait, hardware interrupt, software interrupt& -d Disk stats %read, write& -r '() re*uest stats %read, write& -g #age stats %page in, page out& -i 'nterrupt stats -l +oad stats %, minute average, - minute average, ,- minute average& -m .emory stats %used, buffers, cache, free& -n /etwork stats %received, sent& -s 0wap stats %used, free&
!noupdate will mean that dstat will not refresh until - seconds have passed, otherwise dstat will still actually refresh every , second, it 1ust wont be written to the log file. - also means that the result of the dstat *uery will be logged every - seconds, you can change this to suit your needs however generally ' find that logging system resources every - seconds is plenty. The output of dstat is a .csv file, you can open it as a spreadsheet and view the recorded data easily, making dstat a great overall tool for analysis.