Forum Discussion
I see the issue that you have - I tried to think of a better approach, but I could not find one that meets all the requirements.
For your irule, the first suggestion is to separate out your constants into static variables, and set them in the rule INIT event. You are wasting time and memory by creating those per connection.
when RULE_INIT {
Variables à adapter en fonction du pool conserné.
set static::s_mainMemberIP "x.y.z.1"
set static::s_backupMemberIP "x.y.z.2"
set static::i_memberPort 2049
Active des messages de debug si vaut 1
set static::i_debug 0
}
Try that - I don't know how much CPU you will save, but it is worth a try.
A better (less CPU intensive) approach would be to use iCall
Add an event that detects when the primary pool member is marked up, then drop all connections to the standby pool member (with a tmsh delete sys conn ss-server ). All new connections will be balanced to the primary (assuming it has a higher priority setting).
Or on any pool member down event, swap the priority setting of the pool members so that the currently active pool member has the highest priority until it is marked down, so it will always get the connections.