Wednesday, 13 January 2016

'top' command - always consider 2nd reading for performance metrics

top is one of the most popular, simplest and easiest for capturing system and process performance metrics on *nix platforms.

I use it the most when I'd like to capture the performance metrics when running a specific test case. A simple example would be to write a script that invokes top at regular intervals while the test is running.

Lets say you write a script that redirects the output of the command to a log file. Now, the metrics collected from the script would not give you the "true" system and process performance footprint during the test.

This is because, the very first output from top command is the average values for the various metrics from the start of the OS. The 2nd value is the actual instantaneous reading to be considered if you would like a "true" measurement to be done.

Tuesday, 26 May 2015

Interface stats per sec

During performance tests related to measuring network throughput, it might be necessary to review the per second Bytes In/Out of a given interface.

While there are tools like iotop which provide a lot more features, here is a quick shell script based on 'ifconfig' which gives an instantaneous stat. Comes across very handy for me!


Tuesday, 17 February 2015

Cacti .... How to fix "SNMP Error" when trying to add a device


I was trying to add one of my devices to Cacti with SNMP data query collection and was repeatedly getting a "SNMP Error" when trying to add the device.

The device was enabled for SNMP, and the device MIB was imported on the server running Cacti. Verified that "snmpwalk" from cacti server to my device worked fine.

Turns out... when I configured the device for SNMP v3, I specified the username, but left it as "NoAuth/NoPriv". And looks like Cacti was not ready to accept a blank password for the authentication.

After re-configuring the device with Auth(MD5)/NoPriv and specifying the password in the cacti 'Add Device' screen as well as choosing Privacy as "None", the SNMP Error was gone!

So.. lessons learnt:

  • On your device, if configuring with SNMP v3, then enable "Authentication". (Privacy is optional)
  • On the cacti Add Device page, do the following:
    • Add the Auth passwords to the "SNMP Password (v3)" field
    • Select "SNMP Privacy Protocol (v3)" as None.
Here's a screenshot of the cacti page:

Cacti - Add Device page


Sunday, 18 January 2015

Do you wanna TryPastry? Its yummy !!

Ctrl+C and Ctrl+V are the keys that get used a gazillion times if you're even remotely associated with building software.

Have you been in a scenario where you want to copy-paste multiple items? maintain a history of what you have copied? be able to see the clipboard contents?

Well... TryPastry (www.trypastry.com) and I'm sure you'll love it.

This tiny utility comes with a bunch of features like allowing users to select what to paste, maintain clipboard history across reboots and so on. Most important... its really easy to use! Just use the Win keys instead of the Ctrl keys

Give it a shot... go on! ;)

Wednesday, 10 December 2014

Ganglia... the Big Boss of performance monitoring

In this post, I bring to you a quick intro to Ganglia - an integrated framework for performance monitoring.

Why This Kolaveri Di?

The most challenging (and painful) aspect of System Performance Monitoring is to keep track of historical values, having to sift through 'top' output logs over time, parse them, make meaningful info out of them for a pretty report, and finally... dump them into some folder location (hoping that we never look at it again)... and lo! there is that moment when someone shoots out "Hey! What was the CPU usage pattern, during that week, and this time, when we did some action", and the performance test teams go - "Why this Kolaveri?". Yea... I've been there and experienced that (wink).
So, I embarked on setting up Ganglia, an open source performance monitoring framework for capturing system perf metrics, every hour, every day, every month, and every year.... and automatically! How cool is that !?

When to use Ganglia?

When you have at least two or more systems where you would like to measure the following on a continuous basis, Ganglia comes pretty handy.
  • CPU (User, System, Idle etc.)
  • Memory (Used, Cached, Buffers, etc.)
  • Load and load averages
  • Network I/O

Overview

Ganglia operates on a client / server architecture, where there is a central Ganglia server that receives a regular feed of perf metrics from clients 

The Ganglia server runs the following:
  • Ganglia Monitoring Daemon (gmond) - which polls the system regularly for the performance metrics
  • Ganglia Meta Daemon (gmetad)
The Ganglia clients run the following:
  • Ganglia Monitoring Daemon (gmond) - which polls the system regularly for the performance metrics and reports into the gmond running on Ganglia server.

How to setup ?

There are tons of HOWTOs out there describing installation and config of Ganglia, so I will not go into the specifics. But at a high level here's what you need to know:
  • Setup a simple commodity server (or VM) as the Ganglia server; build and install RRDtool, Gmetad and Gmond
  • To add any client to the Ganglia monitoring, build and install Gmond on the client. Add an entry for the client's IP in the Gmetad.conf file on the server.

Advantages

Here are some features why Ganglia can be very handy:
  • One time pain of setting up the server box; subsequent additions of clients into the monitoring is pretty simple
  • Easy to include additional monitoring capabilities using gmetric and by writing custom python modules
  • And the BIGGEST advantage of all - view performance metrics of servers over YEARS.. Yayy!! (smile)

Tuesday, 9 December 2014

Hello Blog World

Beginning humle... nothing fancy for now. Hope to pen down more as the thoughts flow.