Forum Discussion
smp_86112
Cirrostratus
Apr 19, 2011Which is more efficient - switch or class statement?
We were evaluating a v10 rule today which sets a pool based on the client IP address:
when HTTP_REQUEST {
switch [IP::client_addr] {
"10.15.102.126" -
"10.15.101.14" -
"10.11...
Arie
Altostratus
Apr 21, 2011It depends on the number of items you're checking against. The rule of thumb is to use "switch" up to about a 100 items and a class for more than a 100 items.
However, this is from a performance perspective. One problem I've encountered with using switches is that iRules tend to apply only to new connections. In other words, updates to iRules do not affect existing clients. In my experience classes do not have this drawback.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects