Checking workloads on different resources

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 file:///var/cache/munin/www/localdomain/localhost.localdomain/index.html.

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.

stress

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.



munin data

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.

Processes: Most of my programs were “sleeping” and I had a zombie too, I also had 1 process actively running.

CPU usage: If I understood the graph correctly: most of the time my processor was idle and when in use, I was spending it the most.

CPU frequency scaling: The workload distributed equally to all four cores and the spike at the end resulted from the stress test which almost doubled the load on each core.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s