I am looking for an iRule that can check if the serving pool has all the members down the further request should be forwarded to the sorry page or another pool specified.you can get number of active pool members using active_members command.
active_members wiki
https://devcentral.f5.com/wiki/iRules.active_members.ashx
will the persistence effect the response time if the pool members are again operational.you can disable persistence (i.e. persist none) when sending traffic to another pool while pool is down.
persist wiki
https://devcentral.f5.com/wiki/irules.persist.ashx
Also I want to know how much the irule effects the performance of traffic processing does it really introduce any noticeable delay in request processing???i do not think this will create notable delay because the logic is not complex. anyway, you may compare response time when checking and not checking number of active pool members.
Log Tcp And Http Request Response Info by Aaron
https://devcentral.f5.com/wiki/irules.logtcpandhttprequestresponseinfo.ashx