Sunday, May 8, 2011

The single most import performance metric - WPR

Before we dive into WPR I'd like to take a moment to write about metrics because without metrics there is nothing to measure or tune.  Metrics are the quantities you are going to measure on software and hardware.  More formally a metric is a unit of measure.  There are tons of interesting metrics like %CPU for CPU utilization, Packets Per Second, QPS (Queries per second), FPS (frames per second), RTT (round trip time), and so on.

In general metrics are thought of in two classes - Utilization and Throughput/Latency.  Utilization is a measure of how much something is used so from the previous example %CPU is a utilization metric. Throughput metrics are a measure of the rate at what things are getting done like QPS.  Latency is how long it takes for an individual piece of work to complete like RTT.  Another example of Throughput/Latency is while  Google might do millions of queries a second (Throughput) you the end user are concerned with how fast your query runs (latency).  Server software tends to tune for throughput while interactive software like mobile phone apps tune for latency.

Another term you might have heard is efficiency.  Efficiency is a measure of wasted work.  The more efficient something is the less work is wasting (ie driving around the block twice before parking is likely wasted work).  I dont list it in the metric classes above because both utilization and throughput/latency metrics can be used to derive efficiency.

In my experience throughput/latency measures are more reliable than utilization metrics.  There are lots of reasons for this like Virtual Machines and advanced CPU's tend to skew utilization but not throughput.   You can see a past post of mine that talks about skew on virtual machines here.  If there is interest I can write more on this topic.

Now back to WPR... WPR is Watts per request.  Watts is a measure of the power used.  You might have seen references to Power Performance or Power Utilization etc over the last couple of years but why does it matter so much?  Power utilization is so important these days because of portable devices and data centers.

Ten years ago most computing was under the desk and prior to that it was in a central room.  Power in the central room was interesting however important issues like the speed of computation drove engineering.  Under the desk the costs of inefficient computations (High WPR) was so spread out most people did not notice or care.  However we all have really fast processors now (and yes they can be faster) and a computer in your pocket[book].  In your pocket[book] watts = surfing/talking/dorking time and in the data center watts = heat.  Heat means you have to pay a lot for space and cooling.  The biggest costs for a data center is not the computers but rather the space and power used for cooling.

Now in simpler concepts as to why WPR is so important - lower WPR can make your phone/tablet/laptop last longer and save you money in the datacenter.

So now you might be wondering how to measure power. On Windows machines you can use "c:\windows\system32\powercfg -energy" and on Linux machines you can read sensors (lm-sensors).  The internal computer sensors can be useful however most engineers looking to drive WPR are using external measurement tools like Extech or Intech which are more accurate and have computer readouts which can be used for automation.

Little did you know that Qsort [O(n*log(n))] vs. BubbleSoft [O(n^2)] was making happier users, saving money, and making the world a little greener.  Happy power hunting.

  Tony Voellm

No comments:

Post a Comment