<div dir="ltr"><div>Hi Alex, <br></div><div><br></div><div>Thanks for responding to my issue . I didn't get how the math was done(why it's multiplied by 2) to get 16 slots if possible could you please elaborate with an example.</div><div><br></div><div>Regards</div><div>Premchand <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 10, 2020 at 7:12 PM Alex Rousskov <<a href="mailto:rousskov@measurement-factory.com">rousskov@measurement-factory.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/10/20 6:09 AM, Prem Chand wrote:<br>
<br>
> My squid cache peer has 3 parent IP’s configured. I need to send HTTPS<br>
> requests to the first parent IP for 30 minutes and after to the 2nd<br>
> parent IP for 30 minutes and then to 3rd IP for 30 minutes and this<br>
> switching needs to happen continuously .Could you please let us know how I<br>
> can achieve this?<br>
<br>
If you are OK with hard-coded usage time slots for each peer, then I<br>
would use two[1] "time" ACLs and cache_peer_access rules. Look for<br>
"aclname time" in squid.conf.documented. You will have to generate a<br>
list of (24*2/3=16) staggered time slots for each of the two ACLs, but<br>
it should work. This may be the simplest solution.<br>
<br>
[1] You need two ACLs for three peers because the third peer should get<br>
the requests that the first two peers were not allowed to get.<br>
<br>
----<br>
<br>
With a modern Squid, you could also implement this using a more flexible<br>
(and more expensive, on several layers!) architecture with two ACLs:<br>
<br>
1. An external ACL that returns the right cache peer name to use via a<br>
keyword=value annotation API. This always-matching ACL should be<br>
attached to http_access or a similar directive that supports slow ACLs.<br>
Its goal is to annotate the request. You will need to write a<br>
script/program that will compute the right annotations based on time or<br>
some other factors. This is where the flexibility of this solution is<br>
coming from.<br>
<br>
2. A "note" ACL attached to cache_peer_access directives, allowing<br>
access to peer X if the external ACL in item 1 returned<br>
use_cache_peer_=X. The "note" ACL is a fast ACL and, hence, can be<br>
reliably used with cache_peer_access.<br>
<br>
If you already have another external ACL, you may be able to piggyback<br>
annotations in item 1 to whatever that ACL is already doing.<br>
<br>
For more information, search for "keyword=value" and "acl aclname note"<br>
in your squid.conf.documented and see<br>
<a href="https://wiki.squid-cache.org/Features/AddonHelpers#Access_Control_.28ACL.29" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/Features/AddonHelpers#Access_Control_.28ACL.29</a><br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">prem</div>