Curve dampening for a custom load harness

30 April, 2007 – 1:54 pm

Recently I wrote a test harness that had a ‘discovery’ mode. That is, given a target service level agreement (SLA), what transaction pacing or throughput did the load harness have to apply in order to achieve the SLA response times. Now my maths is a tad scratchy, but I knew that I could somehow figure out the equation to determine how much the load balancer should adjust throughput in order to achieve the desired response time. In my mind I pictured a horizontal line that is the target, and a sinusoidal line that is the actual response time that varies according to load. If I could just figure out how to dampen that curve, I would have the magic formula!


So let’s start with a diagram of what I’m talking about. This is what I am trying to achieve …
dampen.png

There’s many reference’s to this but I couldn’t for the life of me figure out how to
a. Demonstrate this in something like excel, and
b. Create the same harmonic damped effect in a simple java load harness.

Well I couldn’t at first, but here is something that kind of works.

In the following graph, the green line is my SLA of 2,000 milliseconds. The dark blue line is response time that can vary according to load. The light blue line is the varying pacing (or throughput) that is required in order to achieve the SLA. In an excel spreadsheet, the meaning (and calculation) of these values went something like this:
loadbalance.png

symbols.png

So putting it all together in excel works ok. You can download the curve dampening spreadsheet here.

// LOAD BALANCER CALCULATIONS FOR DISCOVER MODE
// Pacing mods based on response time
double diff    = (double)sla - (double)responseTime;
double fract   = diff/1000;
double inv     = 1.00 - fract;
double fractSq = fract * fract;
double factor  = (sla/100) * (sla/100);
          
if(diff<0){
  adjustedPacing = (int)( (fractSq * inv * 100) + factor);
} else {
  adjustedPacing = (int)( (1-(fractSq * 100))+ factor);
}

Share it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netscape
  • Reddit
  • Slashdot
  • Technorati
  • YahooMyWeb

Post a Comment

*
To prove that you're not a bot, enter this code
Anti-Spam Image