SPDY/HTTP2 Profile Impact on Variable Use
When using SPDY/HTTP2 profile, TCL variables set before the HTTP_REQUEST event are not carried over to further events. This is by design as the current iRule/TCL implementation is not capable of hand...
Published Dec 19, 2016
Version 1.0JRahm
Admin
Joined January 20, 2005
JRahm
Admin
Joined January 20, 2005
Kai_Wilke
Mar 21, 2017MVP
Hi Jeremy,
I guess the deletion of a pool is a somewhat rare edge case... So i would say that both the
[table]
and $static::array(key)
approaches are somewhat stable solutions... 😉
The
$static::array($key_name)
approach will be very effective if global or per VS configuration data with limited size needs to become stored (as required in Jasons example). But if the possible $key_name
values are not limited, then it may be wise to implement some addtioanl limiters / garbage collections to control the memory consumption and/or to remove old entries.
In addition the
[table]
command usage of Jasons example can be additionally opimized to avoid cross TMM communication. The trick is to use a different but well selected [table -subtable]
instance for the individual TMM cores, where each -subtable will always become hash-routed to the local TMM core.
when RULE_INIT {
The cmp_hash_array() values are optimized for my 2 TMM core develoment unit
array set static::cmp_hash_array {
0 "table_hash_1"
1 "table_hash_2"
}
}
when CLIENT_ACCEPTED {
table set -subtable $static::cmp_hash_array([TMM::cmp_unit]) "[IP::client_addr]:[TCP::client_port]" [LB::server pool]
}
when HTTP_REQUEST {
set default_pool [table lookup -subtable $static::cmp_hash_array([TMM::cmp_unit]) "[IP::client_addr]:[TCP::client_port]"]
log local0. "POOL: |$default_pool|"
}
Cheers, Kai