LB::persist¶
Description¶
This command forces the system to make a persistence decision, and
returns a string that can be evaluated to activate that selection, or
with the use of the parameter, returns a persistence key that may be
used in conjunction with the persist command to
manipulate the persistence table.
This enables an iRule to evaluate the pending load
balancing/persistence decision early, and use that information to
manage the connection.
Syntax¶
LB::persist
LB::persist key
LB::persist cookie
LB::persist¶
- Forces the system to make a persistence decision. Returns a string, part of which can be evaluated to activate that selection.
Return value when no persistence is configured:
- Return value when source persistence is configured, but no record
- matches this connection:
source_addr 0
Return value when source persistence is configured, and a record
matches this connection (string format not verified -deb):
source_addr 192.168.10.1:80
Use the Tcl eval command to evaluate the
second field of the return value and actually make the pick.
(Not sure yet about the specific conditions that should be tested here
re: no persistence applied, persistence applied but no record matches
this conn, etc.)
LB::persist key¶
- Returns the system generated persistence key matching this connection, or null if no match was found. May be used to manipulate the persistence table directly using the persist command.
Return value when source persistence is configured, but no record
matches this connection:
source_addr :: 0
Return value when source persistence is configured, and a record
matches this connection (string format not verified -deb)
source_addr :: 192.168.10.1:80
LB::persist cookie¶
- No clue on this one… ===Examples===
To evaluate the persistence record early, then use it if it exists:
when HTTP_REQUEST {
set mypick [LB::persist]
log local0. "The persistence entry is: $mypick and the key is [LB::persist key]"
if { [lindex $mypick 1] ne "0" }{
# Execute the pick
eval [lindex [LB::persist] 1]]
} else {
log local0. "No persistence record found"
}
}