Forum Discussion
hoolio
Cirrostratus
Oct 07, 2009matchclass versus class in v10 for address comparisons?
Is there any advantage to using class match versus matchclass to evaluate an IP address against an address type datagroup?
Here is a simple iRule I used to test class/matchclass for an IP against the AOL datagroup. Both commands seem to return expected results (with matchclass returning the record number of the matched result).
when RULE_INIT {
log local0. "\[class match 205.188.112.0 equals aol\]: [class match 205.188.112.0 equals aol]"
log local0. "\[class match 1.1.1.1 equals aol\]: [class match 1.1.1.1 equals aol]"
log local0. "\[matchclass 205.188.112.0 equals aol\]: [matchclass 205.188.112.0 equals aol]"
log local0. "\[matchclass 1.1.1.1 equals aol\]: [matchclass 1.1.1.1 equals aol]"
}
And the log output from one TMM:
[class match 205.188.112.0 equals aol]: 1
[class match 1.1.1.1 equals aol]: 0
[matchclass 205.188.112.0 equals aol]: 7
[matchclass 1.1.1.1 equals aol]: 0
Thanks,
Aaron
16 Replies
- The_Bhattman
Nimbostratus
I don't think there is much of a difference between matchclass. As I have read it's a new class that extends the findclass and matchclass commands.
My 2 cents
CB - hoolio
Cirrostratus
Hi CB,
Thanks for that. I'm assuming matchclass is left for backward compatibility but the class functions will provide more functionality.
Aaron - hoolio
Cirrostratus
Thanks for the info, Colin.
Aaron - hoolio
Cirrostratus
Just as a follow up on this, I'm seeing a vast improvement in 10.2.1 between the performance of 'class search' versus 'findclass' for looking up a name and corresponding value in a datagroup. ie, the unit dies with 100% TMM CPU usage when using findclass. But it is under 35% average TMM CPU usage when searching all of the way through a 100,000 entry datagroup with 'class search'.
I would definitely recommend replacing findclass/matchclass with the corresponding class commands in 10.x iRules.
Aaron - Chris_Miller
Altostratus
Thanks for the info Aaron - I'm on 10.2 right now but will be doing to 10.2.1 soon. I have an iRule that relies heavily on that value extraction so I'll keep an eye on the improvement. - hoolio
Cirrostratus
I think the improvement would be from 10.0 so the specific version of 10.x shouldn't make a difference.
Aaron - Chris_Miller
Altostratus
One of the 10.2.1 release notes mentioned an iRule CMP improvement IIRC - never heard what that was so I assumed it was this? - hoolio
Cirrostratus
http://support.f5.com/kb/en-us/products/big-ip_ltm/releasenotes/product/relnote_10_2_1_ltm.html
TMM with iRules and CMP (ID 225747)
Enhancements have been made to the Traffic Management Microkernel (TMM) with respect to iRules™ and clustered multi-processing (CMP).
This fix was related to SIP/UDP timing with CMP. The release note description wasn't very useful :)
Aaron - hoolio
Cirrostratus
Here is Joe's test results comparing the performance for the 10.x class command with if/elseif/else, switch, switch -glob and matchclass:
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1086424/Comparing-iRule-Control-Statements.aspx
The class command wins out dramatically in just about every case.
Aaron - Colin_Walker_12Historic F5 AccountAnd the gains only get bigger and more stark the deeper into the construct the match occurs. For instance, a switch with 500 entries is slightly slower than a class when the match is the 5th or 10th item in the switch. When it's the 498th, the difference is even more apparent. This goes double for things like if/else chains.
Colin
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
