Direct traffic to pool member according to client connection by bytes

Can anyone help me for IRule to direct the traffic to certain pool member according to client request measured by byte when access VIP

for example if client request connection is 3 packet/byte >> direct this request to pool member x.x.x.x

we need just to direct the connection according to KB or Byte for client connection

This is a strange requirement, but here goes:

I suspect you may have to do your own accounting.

For each connection, you can initiate

TCP::collect

.

With no argument specified, the event

CLIENT_DATA

will fire for every packet received, and you can count packets like that.

Otherwise, you can specify bytes, and the event will fire after the set number of bytes (at least) is received.

Once you’ve reached the counts you want then you can call

pool

command to redirect the traffic accordingly.

On the small chance that you’re at a service provider trying to do traffic accounting, I am almost certain there are more efficient ways of doing something like this at scale, and you should probably engage with a consultant or architect to evaluate.