I am writing this post as part of Tero Karvinen’s course: Linux palvelimena (roughly translated: Linux as a server) http://terokarvinen.com/2012/aikataulu-linux-palvelimena-ict4tn003-4-ja-ict4tn003-6-syksylla-2012.
On this post I will go through the following:
- Install munin
- Check a process with the following tools: top, iotop, netstat and lsof
- Use stress-program to see the load on different resources
- Go through the data collected by munin
EDIT: I added a ‘$’ character to make it easier to read commands that I use in the terminal, so don’t copy those!
So we start of by installing munin
$ sudo apt-get install munin. I opened firefox and wrote the following address
top, iotop, netstat and lsof
I decided to use a screensaver as the process which I wanted to analyze the load on my computer. I will open 6 screensaver daemons by using the following command on terminal:
$ /usr/lib/xscreensaver/glcells & six times. It is faster to use the “up-key” after you have done it once. (you can check other available screensavers by using
$ xscreensaver-demo and swapping the name. Remember the ‘&’ at to the end).
Using the command
$ top, we can see how much resources, cpu and memory the screensavers are using. Next I tried using iotop
$ sudo apt-get install iotop
$ sudo iotop but I didn’t see anything useful since it shows the data of the disc and I am using a live-environment.
Next up was netstat which monitors your network statistics (
$ netstat ). I couldn’t find a trace of GLCells while using netstat, which was expected since it is a screensaver.
lsof shows you a lists of open files (
$ sudo lsof|less we need administrative rights to use it and less shows it a screen at a time so it is easier to read). I found a lot of hits, so I decided to try with only one GLCells opened. I closed all of the GLCells with the command
$ killall glcells and opened a new one with the same command as before and after that I retried the lsof. This time the amount was more manageable. I killed the last GLCells with the same command as before.
Next I am going to use stress (“tool to impose load on and stress test systems” -from man page)
$ sudo apt-get install stress I’ll be testing my processor by using the following command
$ stress --cpu 8 --timeout 120s The top-program showed that the stress test took 100% of my cpu.
There were a lot of graphs so I took which I believed were the most interesting ones.
Memory usage: Surprisingly (at least for me) it seems that the cache took the biggest chunk of my memory followed by active and inactive programs and apps. I seem that I had only 1.6gb of free ram out of 6gb which seems pretty little compared to what I did.