<div dir="ltr"><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Jan 3, 2025 at 8:23 AM Jonathan Lee <<a href="mailto:jonathanlee571@gmail.com">jonathanlee571@gmail.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">Hello fellow Squid Users,<br>
<br>
I understand this directive is removed in Squid7 again I am still trying to understand more about what it did and does in the older versions of software. <br>
<br>
pipeline_prefetch historically was on or off for settings however today it is n+1 or a numerical value for the variable n.<br>
<br>
My question is after many trial and errors what is a good range to use for a 4GB memory system, <br>
<br>
I have attempted many different n values some being 100, 200, 300, 5, 10 etc it appears to work well with 100 or maybe it was my other changes with <br>
using the directive read_ahead_gap 64 KB and testing 16 and 32 <br>
<br>
what is a good solid go go juice number for pipeline_prefetch? I do notice massive increases in facebook loads when I have it at 100 however decreased performance with news websites. It is like a can’t win directive for me. Finally I thought best to ask.</blockquote><div><br></div><div><div>HTTP is a request-response protocol, and HTTP/1.1 uses a single TCP connection to issue several requests via the "keep-alive" feature.</div><div><br></div><div>The way it is supposed to work is:</div><div>- client opens TCP connection</div><div>- client sends request #1 on connection</div><div>- server sends response #1 on connection</div><div>- client sends request #2 on connection</div><div>- server sends response #2 on connection</div><div>- ...</div><div>- client or server closes TCP connection</div><div><br></div><div>There are several reasons why a connection might be closed. Among them, axplicit decision by the client or server for instance due to wanting to terminate the process to avoid leaking too much memory, or an inactivity timeout, or because the server doesn't know in advance how long a response is going to be, so the only way to terminate the response is by closing the connection.</div><div><br></div><div>Sometimes however the client knows in advance several resources it wants to fetch, and sometimes it will perform these requests optimistically, without waiting for the previous responses. The flow in this case can look like:</div><div>- client opens TCP connection</div><div>- client sends request #1 on connection</div><div>- client sends request #2 on connection</div><div>- server sends response #1 on connection</div><div>- server sends response #2 on connection</div><div>- ...</div><div>- client or server closes TCP connection</div><div><br></div><div>pipeline_prefetch instructs squid to try and detect these events, and to optimistically start processing requests before having completed the previous responses. This can in theory help reduce page rendering latency, but it comes with several drawbacks:</div><div>- the feature triggers bugs in Squid - see <a href="https://joshua.hu/squid-security-audit-35-0days-45-exploits">https://joshua.hu/squid-security-audit-35-0days-45-exploits</a></div><div>- the feature can actually harm performance: if squid needs to close the TCP connection at the end of response #1, but has already downloaded uncacheable content for request #2, that content has to be discarded</div><div>- modern web clients adopt complex optimization strategies when picking what resources to download, making this optimization less and less relevant</div><div>- that's the reason why it was dropped as a feature: its benefit is doubtful, the drawbacks are known and measurable, the complexity it adds to squid is significant. We developers would rather clean the slate and work on supporting http/2 which makes this whole problem go away</div><div> </div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I do understand it is no longer recommended to be used this is simply for speed and the system is secure behind a firewall.</blockquote><div><div><br></div><div>I'd just recommend to not use it :)</div><div><br></div><div>--</div></div></div><div dir="ltr" class="gmail_signature"> Francesco</div></div>