Forum Discussion
Michael_Yates
Apr 29, 2010Nimbostratus
It should be more efficient to do a qualifying compare and an action if it meets your criteria.
If client IP Address is in the matchclass data set, do this....
Your code is doing a variable set and then a compare.
Set hostip variable if the clients IP Address is in the matchclass data set.
Then
If the hostip is not equal to nothing / null, do this....
iRule efficiency is generally sacrificed for readability, but if this iRule has to be processed a couple of hundred times per second, it could add up to some processing latency.
I would try this. It does the compare and either applies the persistence or releases the traffic to the pool of the Virtual Server it is applied to:
when CLIENT_ACCEPTED {
if { ([matchclass [IP::remote_addr] equals $::TestDataGroup ]) } {
persist source_addr 28800
}
}