Forum Discussion
Is it normal for F5 LTM CPU to hike 10% extra with iRule implementation?
You can save a bit of CPU cycles by not doing the data group lookups on each HTTP request. You could do this once at config load time by moving the lookups to RULE_INIT:
when RULE_INIT {
set static::maxActiveClients "[class search -all -value datagroup_selfridges_waitingroom starts_with "max_active_clients"]"
set static::subtableName "sessionLimit"
set static::sessionCookieName "[class search -all -value datagroup_selfridges_waitingroom starts_with "session_cookie_prefix"]"
set static::holdingPage "[class search -all -value datagroup_selfridges_waitingroom starts_with "holding_page_url"]"
set static::sessionTimeout "[class search -all -value datagroup_selfridges_waitingroom starts_with "session_timeout"]"
}
If you want some/all of these lookups done more frequently, you could move them to the CLIENT_ACCEPTED event instead. Maybe the timeout and max_active_clients?
You can check if the cookie value isn't null in one step like this:
Current:
if {[HTTP::cookie exists $sessionCookieName]}{ set client_id [HTTP::cookie $sessionCookieName]`
Suggested:
if {[set client_id [HTTP::cookie $sessionCookieName]] ne ""}{
You can save a bit of CPU by using ne instead of != for text comparisons:
Current:
if { $sessiondata != "" } {
Suggested:
if { $sessiondata ne "" } {
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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