WG: Scaling the number of users instead of the hit rate

Hohl, Gerrit g.hohl at aurenz.de
Wed Feb 15 10:46:44 UTC 2012


Hello everyone,

I went through the code of web polygraph 4.3.2. And I guess I found the parts which do the calculation of the numbers for robots and servers. I wrote a small Java class that does this calculation so I can play with the values without starting the polygraph-client and polygraph-server over and over again:

public class Test
  {

  /**
   * @param args
   */
  public static void main(String[] args)
    {
    double max_host_load, max_agent_load, peak_req_rate;
    int agents_per_addr, robotCnt, serverCnt;
    
    peak_req_rate = 500;
    max_host_load = 20000;
    max_agent_load = 6 / 60d;
    agents_per_addr = 2;
    
    System.out.println("Parameters");
    System.out.println("   Peak req. rate (per sec.) : " + peak_req_rate);
    System.out.println("   Max host load (per sec.)  : " + max_host_load);
    System.out.println("   Max agent load (per sec.) : " + max_agent_load);
    System.out.println("   Agents per addr.          : " + agents_per_addr);
    robotCnt = calcRobots(peak_req_rate, max_host_load, max_agent_load, agents_per_addr);
    serverCnt = calcServers(peak_req_rate, max_host_load, robotCnt);
    System.out.println("Result");
    System.out.println("   No# of robots  : " + robotCnt);
    System.out.println("   No# of servers : " + serverCnt);
    }
  
  public static int calcServers(double peak_req_rate, double max_host_load, int robotCnt)
    {
    /*
     * /pgl/PolyMix4AsSym
     * String servers(ArraySym *&addrs)
     */
    int minSrvCount, hostCnt, agentCnt;
    
    minSrvCount = (int)(500.5 + (0.1 * robotCnt));
    
    hostCnt = (int) xceil(peak_req_rate, max_host_load);
    agentCnt = singleDiv(hostCnt, minSrvCount);
    
    System.out.println("Servers");
    System.out.println("   No# of hosts  : " + hostCnt);
    System.out.println("   No# of agents : " + agentCnt);
    return agentCnt;
    }
  
  public static int calcRobots(double peak_req_rate, double max_host_load, double max_agent_load,
      int agents_per_addr)
    {
    /*
     * /pgl/VerFourAsSym
     * String addresses(const BenchSideSym *side, ArraySym *&addrs)
     */
    int maxAgentsPerHost, maxAddrPerHost, hostCnt, agentCnt;
    
    maxAgentsPerHost = (int) xceil(max_host_load, max_agent_load);
    maxAddrPerHost = (int) xceil(maxAgentsPerHost, agents_per_addr);
    
    hostCnt = (int) xceil(peak_req_rate, max_host_load);
    agentCnt = singleDiv(hostCnt * agents_per_addr,
        doubleDiv(hostCnt, peak_req_rate, max_agent_load));
    
    if (agentCnt > agents_per_addr * maxAddrPerHost * hostCnt)
      System.out.println("too many agents?");
    
    System.out.println("Robots");
    System.out.println("   No# of hosts  : " + hostCnt);
    System.out.println("   No# of agents : " + agentCnt);
    return agentCnt;
    }
  
  public static double xceil(double nom, double denom)
    {
    /*
     * /xstd/gadgets.cc
     */
    double cex, cm1, cp1, dm1, dex, dp1, result = 0;
    
    cex = Math.ceil(nom / denom);
    cm1 = cex - 1;
    cp1 = cex + 1;
    
    dm1 = Math.abs(nom - (cm1 * denom));
    dex = Math.abs(nom - (cex * denom));
    dp1 = Math.abs(nom - (cp1 * denom));
    
    if ((dm1 <= dex) && (nom <= cm1 * denom))
      result = ((dm1 <= dp1) || !(nom <= cp1 * denom)) ? cm1 : cp1;
    else
      result = ((dex <= dp1) || !(nom <= cp1 * denom)) ? cex : cp1;
    
    return result;
    }
  
  public static int singleDiv(int factor, double n)
    {
    /*
     * /pgl/AddrSchemeSym
     */
    return (int)(factor * xceil(n, factor));
    }
  
  public static int doubleDiv(int factor, double n, double d)
    {
    /*
     * /pgl/AddrSchemeSym
     */
    double apx;
    
    apx = xceil(n, d);
    return singleDiv(factor, apx);
    }

  }

And it seems that the formula of my last post was right: I get the expected values for the given values.
One remark about my Java code: It only implements PolyMix4. You can't calculate other schemes like PolyMix3As and so on as they may have a different formula.
That means if I want to scale the number of robots but not the request rate, I have to transform the formula like this:

   robots = peak_req_rate / max_agent_load

   -> peak_req_rate  = robots * max_agent_load

In my case the following is constant

   max_agent_load = 6/min;

So when I want a different number of robots, I have to calculate the resulting peak_req_rate.

 robots | peak_req_rate
--------+---------------
   1000 |       100/sec
   2500 |       250/sec
   5000 |       500/sec
   7500 |       750/sec
  10000 |      1000/sec
  15000 |      1500/sec
  20000 |      2000/sec
  30000 |      3000/sec
  50000 |      5000/sec
    ... |           ...

Can someone please confirm my theory?

Regards,
Gerrit

-----Ursprüngliche Nachricht-----
Von: Hohl, Gerrit 
Gesendet: Mittwoch, 15. Februar 2012 10:09
An: 'users at web-polygraph.org'
Betreff: AW: Scaling the number of users instead of the hit rate

Good morning everyone,

maybe I should change my question a little bit: In the following article I found a formular for calculating the expected numbers of robots: http://polygraph.ircache.net/Workloads/PolyMix-2/

"[...] 6.2 Number of clients and servers

Given the total request rate RR req/sec, we allocate (R = RR/0.4 = 2.5*RR) robot IP addresses (0.4 is request rate for an individual robot). The number of server IP addresses is then 0.1*R+500. Robot and server IPs are distributed evenly and sequentially across Polygraph machines (see example).

We place a limit of 1000 robots per client machine. The number of server machines is equal to the number of client machines.

When the calculations produce non-integer value V, we round towards the closest integer greater than V. [...]"

Does that also apply if I use  the PolyMix4As class?

Bench theBench = {
        peak_req_rate = 500/sec;

        client_side = {
                max_host_load = 20000/sec;
                max_agent_load = 6/min;
                addr_space = ... ;
                hosts = ... ;
        };

        server_side = {
                max_host_load = client_side.max_host_load;
                max_agent_load = undef();
                addr_space = ... ;
                hosts = ... ;
        };
};

PolyMix4As asPolyMix4 = {
        agents_per_addr = 2;
};

Will this configuration result in 5000 robots, 2 robots on each of 2500 IP addresses?

robots = peak_req_rate / max_agent_load = 500/sec / 6/min = 30,000/min / 6/min = 30,000 / 6 = 5000

Regards
Gerrit


-----Ursprüngliche Nachricht-----
Von: users-bounces at web-polygraph.org [mailto:users-bounces at web-polygraph.org] Im Auftrag von Hohl, Gerrit
Gesendet: Montag, 13. Februar 2012 13:25
An: users at web-polygraph.org
Betreff: Scaling the number of users instead of the hit rate

Hello everyone,

after a longer pause I'm now at our stress testing again. One thing is that I have to include NTLM authentification. Dimtry already wrote a message her and will try it now.

But my problem now is that I should be able to scale the number of users
(robots) instead of the hit rate. Our product is more sensitive to this than the hit rate as our focus is on authentification. We don't do any caching or things like that. So is there a possibility to scale users?
Or maybe I should ask the question in a different way: Is there a way I can calculate the number of expected robots from other values like Bench.client_side.peak_req_rate, Bench.client_side.max_host_load or Bench.client_side.max_agent_load?

Regards
Gerrit
_______________________________________________
Users mailing list
Users at web-polygraph.org
http://www.web-polygraph.org/mailman/listinfo/users



More information about the Users mailing list