[squid-users] What's the algorithm to achieve AclRandom

Amos Jeffries squid3 at treenet.co.nz
Sun Sep 18 07:49:52 UTC 2016


On 18/09/2016 7:25 p.m., yanghe wrote:
> Hi
> Although he said it was random,certainly based on an algorithm.
> I would like to know what's the algorithm or principle  to achieve AclRandom.


ACL random uses the operating system random() number generator.

A new random number is selected each time the ACL is checked. The ACL
will declare match vs. no-match depending on whether that number is
below or above a defined squid.conf threshold value.

> Can I make certain the next traffic will go to which Web server?

Not using ACL random.

For certainty you need one of the many load balancing cache_peer
selection algorithms. Which naturally require the server(s) to be
cache_peer.

Amos



More information about the squid-users mailing list