Quantcast



Docs


Blogs


Forums


Samples


Media


Labs


Resources

 




DevCentral > Weblogs > Deb Allen - DebCentral
 CMP-compatible Class Lists
posted on Monday, July 28, 2008 4:25 PM

Current versions of LTM have implemented Clustered Multi Processing, or CMP, to allow systems with multiple cores to share the processing of connections from a single virtual server.  Not all connection information is shared across cores, so enabling some features on a virtual server which require state or data synchronization between the cores will cause connections to be ineligible for CMP. 

In iRules, global variables are intended to be dynamically updated, for which reason they are appropriately demoted from CMP processing.  Data Group Lists, or Classes, are a specific form of global variable. Since class data is read-only, and is available to all cores upon configuration load, there is no dynamic data sharing required between TMM instances, and there is no real need to demote a virtual server from CMP processing simply because it is represented as a global variable.

The LTM configuration parser identifies global variables (including classes) by the "$::" preamble:

  [ matchclass $HTTP_CONTENT contains $::my_data_class ]

In LTM 9.4.2, we introduced the ability to reference class lists from within an iRule without demoting them from CMP by referencing them without the "$" prefix.  To call a class list in a 9.4.2 or better iRule, use the findclass or the matchclass command with the new syntax:

  [ matchclass $HTTP_CONTENT contains ::my_data_class ]



Email This
  del.icio.us
      

Feedback


7/29/2008 1:55 PM
Gravatar How about this iRule?
when HTTP_REQUEST {
log local0. "$::Forbidden_Headers"
log local0. "[HTTP::header names]"
foreach Header $::Forbidden_Headers {
log local0. "$Header"
if { [HTTP::header exists $Header] } {
discard
break
}
}
}

If I have a string class of forbidden headers, how do I make the above iRule CMP compatible?
Pat

7/29/2008 4:07 PM
Gravatar I think you could accomplish that by dropping the logging of the class members & turning the comparison around the other way to use the matchclass command:
-
when HTTP_REQUEST {
..log local0. "[HTTP::header names]"
..foreach Header [HTTP::header names] {
....log local0. "$Header"
....if { matchclass $Header equals ::Forbidden_Headers] } {
......discard
......break
....}
..}
}
deb

7/29/2008 4:31 PM
Gravatar The only thing that I don't like about your solution is that the number of Forbidden Headers is likely to be less than half the length of [HTTP::header names].
Pat

8/6/2008 10:35 AM
Gravatar Does this only work (dropping the $ sign) on a system with CMP enabled or should it still work on a single core system... just not do anything?
Aaron

8/6/2008 2:19 PM
Gravatar @Pat - May not be optimal, but you gain the advantage of CMP compatibility, should more than make up for it, I think...

@Aaron - it was a software change, so I would assume it works on any hardware platform as long as you are running the correct LTM version
deb
 Leave Feedback
Title  
Name  
Email
Url
Comments   
Please add 3 and 3 and type the answer here: