Persistence aFlex based on UIE from real server
Posted by aanchev
This script was written for a home grown web application that sets a UIE when a client establishes a connection to the server. If a client has no UIE, it is load balanced normally. If the client has a UIE, the script provides stickiness to the server the client received it from.
when HTTP_REQUEST {
set query [HTTP::query]
if { $query contains "rid=" } {
log local0. "Query value: $query"
set tempvalue [getfield [HTTP::query] "rid=" 2]
log local0. "Temp value: $tempvalue"
set value [substr $tempvalue 0 "&"]
log local0. "Parsed rid: $value"
set persistvalue [persist lookup uie $value all]
if { $persistvalue ne "" } {
persist uie $value
}
}
}
when HTTP_RESPONSE {
persist add uie $value 3600
}
This script was written for a home grown web application that sets a UIE when a client establishes a connection to the server. If a client has no UIE, it is load balanced normally. If the client has a UIE, the script provides stickiness to the server the client received it from.
when HTTP_REQUEST {
set query [HTTP::query]
if { $query contains "rid=" } {
log local0. "Query value: $query"
set tempvalue [getfield [HTTP::query] "rid=" 2]
log local0. "Temp value: $tempvalue"
set value [substr $tempvalue 0 "&"]
log local0. "Parsed rid: $value"
set persistvalue [persist lookup uie $value all]
if { $persistvalue ne "" } {
persist uie $value
}
}
}
when HTTP_RESPONSE {
persist add uie $value 3600
}
0