Hi all,
I would like to be able to use lua-resty-balancer to load-balance between multiple upstream servers and preferentially select upstreams with fewer open connections.
It seems to me that it would be possible to maintain a count of connections to each server by incrementing a shared dict in a balancer_by_lua_block and decrementing in a log_by_lua_block. I can then select an upstream with fewest connections in the balancer_by_lua_block.
Can anyone identify a reason why this would be a bad idea, or any better ways to achieve the same thing?
Thanks,
Ashley