Forum Discussion

Romel_77740's avatar
Romel_77740
Icon for Nimbostratus rankNimbostratus
Apr 27, 2008

irule timing: how to convert Cycles to Seconds

One of the irule tutorials states that if "timing on" argument is set on "when", the irule statistics tab will show the timing information. I do not see any irule statistics tab on irule editor, and on the bigIP GUI irule statistics, I do not see any timing information. The statistics only show Total executions, failures and Aborts. So I assume this is an incorrect statement in the tutorial.

 

 

Now tutorial also shows the command that can be applied to show timing. This does work and a sample shown below. But the timing is in cycles. WHat is the relationship between timing in cpu cycles to Seconds (which is what a human will want to see as) ?

 

 

b rule sbcuachandle2 show all

 

RULE sbcuachandle2

 

+-> CLIENT_ACCEPTED 10 total 0 fail 0 abort

 

| Cycles (min, avg, max) = (40435, 83870, 148659)

 

3 Replies

  • | Cycles (min, avg, max) = (40435, 83870, 148659)

     

     

    First off, you'll want more than 10 iterations of the rule to get a good average. The Min and Max aren't really applicable and can greatly throw off the average. You'll notice as you run this rule more times that the average will float to a lower and more stable number because the Max number isn't throwing it off as much.

     

     

    The numbers you are seeing here correlate to the number of CPU cycles used to execute this rule. Divide by the number of cycles available on the model LTM you are running. For instance if you were running on an LTM 6800 (with a 2.4ghz proc) you would divide 2,400,000,000 by 83,870. This rule could theoretically fire 28k times per second before overrunning the CPU. Stated another way, the rule takes up .0035 percent of a one second time slice of the CPU.

     

     

    Keep in mind that the LTM is using the CPU for many purposes, including basic load balancing and processing of packets. If your CPU was at %30 before with a maximum of 1,000 new connections per second, then adding the iRule will bump the LTMs CPU to %30 + (1000 * .0035) = %33.5
  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus
    In the iRule editor, right-click on an iRule and select "properties". There's a statistics tab. Under "metrics" you will find the runtime (in ms). Make sure you adjust the CPU speed as appropriate.