Forum Discussion
Absarkhan_15403
Nimbostratus
Jul 31, 2014Is it normal for F5 LTM CPU to hike 10% extra with iRule implementation?
Hi All,
I have two questions regarding below iRule;
when HTTP_REQUEST priority 1 {
set static::maxActiveClients "[class search -all -value datagroup_selfridges_waitingroom starts_with ...
hoolio
Cirrostratus
Aug 01, 2014You 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
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