[squid-users] How to make each user go to different cache_peer

Alex Rousskov rousskov at measurement-factory.com
Thu Aug 19 15:26:09 UTC 2021


On 8/19/21 9:53 AM, Lucas Pelegrino wrote:
> Hey guys.
> 
> I'm trying to loadbalance my cache_peers based on which user is
> authenticated, so far this is what I came up with using the "userhash"
> loadbalance method:
> 
> cache_peer localhost parent 6667 0 no-query userhash name=proxy1
> cache_peer localhost parent 6668 0 no-query userhash name=proxy2
> 
> This works, the same user is always sent to the same cache_peer, but the
> thing is I want specific users to go through specific peers.
> 
> For instance, user "dummy1" will always go to "proxy1" and user "dummy2"
> will go to "proxy2".

Sure. Remove userhash loadbalancing and use cache_peer_access to select
the right peer for each transaction.

Alex.



More information about the squid-users mailing list