I would like o confirm if my calculations are correct (based on iRule timing video😞
- CPU budget 4 000M
- Linux overhead 20% - available budget 3 200M
- Average CPU usage without iRule - 30%
- Available CPU budget without crossing 70% CPU usage - 1 280M
- Expect iRule executions per second 2 500
- Max iRule CPU usage to not cross 70% - 512K
And now I am a bit surprised. Simple iRule like below
when HTTP_REQUEST {
HTTP::header remove X-Forwarded-For
if { [HTTP::header value "X-Our-Custom-IP"] ne ""} {
HTTP::header insert X-Forwarded-For [HTTP::header value "X-Our-Custom-IP"]
} else {
HTTP::header insert X-Forwarded-For [IP::client_addr]
}
}
Is after 116 executions showing average 94.1K so it is around 18,38% of available max CPU cycle usage limit (512K)
Seems that there is quite a limited option for heavy iRule here.
Is above more or less correct?
If so my last question is how to calculate theoretical available CPU budget based on known TMOS version (11.5.+) number of CPU, cores per CPU and CPU speed?
I am especially interested how to do that for VE. Is that safe to use host machine CPU speed times number or vCPU for calculation?
Piotr