Forum Discussion

K_E_49611's avatar
K_E_49611
Icon for Nimbostratus rankNimbostratus
Sep 14, 2005

Rules / Class / Performance

Hello,

 

 

I am trying to determine the best way to manage traffic using rules. Based these posts, it seems the classes are the way to go.

 

 

My understanding:

 

 

1) classes are better than multiple conditions

 

2) once a condition is satisfied, the rule stops being parsed

 

3) best to have muliple rules with fewer conditions than few rules with more conditions.

 

 

My example: 1000 logical pools; Each pool = 2 Nodes(IP:Port); 100 Physical Servers;

 

 

Which scenario will provide better performance A, B, same or other?

 

 

If B, is there a point where too many classes is a hindrance?

 

 

Scenario A: 20 rules = each rule having 50 if / else-if conditions, one per pool = 1000 elements

 

 

If http_uri contains “string1”

 

use pool string1

 

else if http_uri contains “string2”

 

use pool string2

 

else if …etc x 50

 

 

Scenario B: 5 rules = with 10 classes IFs, each with 20 sub-conditions = 1000 elements

 

 

ClassA = "string1" "string2" ..etc x 10

 

ClassB = "sting30" "string31" ...etc x 10

 

Class ...etc x 10 classes.

 

 

If http_uri contains one of classA

 

{ If http_uri contains “string1”

 

use pool string1

 

else if http_uri contains “string2”

 

use pool string2

 

…etc x 10

 

}

 

Else if http_uri contains one of classB

 

{ If http_uri contains “string30”

 

use pool string30

 

else if http_uri contains “string31”

 

use pool string31

 

…etc x 10

 

Else if …etc x 10 class IF’s.

 

 

 

Scenario A - the rule would have to be checked max 49 times before the last condition is met.

 

Scenario B - the rule would have to be checked 9 Main IF's + 9 Inner IF's before getting to the very last conditions = 18 checks.

 

 

B sounds obvious, looking for feedback, other pointers or opinions.

 

 

Sorry for the long read, thanks for sticking it out.

 

  • A few questions:

     

     

    1) Why so many pools?

     

    2) Is the URL -> pool mapping 1-to-1 or many-to-1? It seems 1-to-1. If, so, why?

     

    3) How equally is the traffic distrubuted among pools?

     

    4) What do the strings represent?

     

     

    -Brian

     

     

    P.S. - It helps if you can give us some background.
  • Here's more info, thanks for helping.

     

     

    1 We used to run .asp and had many sites per pool with more nodes per pool. We have moved to .jsp and are limited by physical memory (each JVM takes X amount) therefore we have less sites + nodes per pool = more pools.

     

     

    2 Each JVM listens on its own port making it very flexible to manage (marking down) without affecting other sites in a pool (as opposed to all using port 80); therefore 1-to-1 URL to pool. Each pool = 1 client instance of our app.

     

     

    3 How equally is the traffic distrubuted among pools?

     

     

    Can't say at this time, I generally compare the pool stats and move the "bigger" clients to the top of the rule. Using the new method, I would rank the server pools and then each client site within each pool.

     

     

    4 URL's: http://productname.company.com/clientname/

     

     

    Strings = "clientname" as shown in above URL.