<div dir="ltr">Hi Alex,<div><br></div><div>Thanks a lot for the clarification on the config for running multiple workers with version 5.1, its a lot simpler now with just the "workers" config! I have been able to resolve the "<span style="color:rgb(80,0,80)">commBind Cannot bind socket FD" </span>error by ensuring the var/run/squid folder is created with write permissions. I have a docker container (ubuntu) with squid configured with the --localstatedir option prior to build (as the installation is at /squid), I have managed to fix it with some changes to the docker entrypoint script and am able to run 16 kid processes on my test server. However, I am still trying to get the container working in a nomad job (which was fine with version 4.13 with almost the same config but w/o additional workers). I havent been able to extract the cache log when run inside nomad so far, will try again and post here if I need further assistance on that.</div><div><br></div><div>BTW, when I attempt to use the following config with 5.1 the cache log says that I need to run <span style="font-family:"Helvetica Neue";font-size:13px">'squid -z' to create the swap directories. Is that something I would need to add to my Docker build steps so that it is set up before the squid server is run? </span></div><div><span style="font-family:"Helvetica Neue";font-size:13px"><br></span></div><div><span style="font-family:"Helvetica Neue";font-size:13px">Thanks again for the config examples and pointers. </span></div><div><br></div><div><span style="font-family:"Helvetica Neue";font-size:13px">Praveen</span></div><div><span style="font-family:"Helvetica Neue";font-size:13px"><br></span></div>





<div>"cache_dir ufs /squid/var/cache/squid 400000 16 256"</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| Swap maxSize 409600000 + 262144 KB, estimated 31527857 objects</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid4| storeDirWriteCleanLogs: Operation aborted.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| Target number of buckets: 1576392</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| Using 2097152 Store buckets</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid4| FATAL: <span class="gmail-Apple-tab-span" style="white-space:pre"> </span>Failed to verify one of the swap directories, Check cache.log</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>for details.<span class="gmail-Apple-converted-space">  </span>Run 'squid -z' to create swap directories</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>if needed, or if running Squid for the first time.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| Max Mem<span class="gmail-Apple-converted-space">  </span>size: 262144 KB [shared]</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| Max Swap size: 409600000 KB</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| ERROR: /squid/var/cache/squid/00: (2) No such file or directory</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| Not currently OK to rewrite swap log.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid4| Squid Cache (Version 5.1): Terminated abnormally.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| storeDirWriteCleanLogs: Operation aborted.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| FATAL: <span class="gmail-Apple-tab-span" style="white-space:pre"> </span>Failed to verify one of the swap directories, Check cache.log</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>for details.<span class="gmail-Apple-converted-space">  </span>Run 'squid -z' to create swap directories</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue""><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>if needed, or if running Squid for the first time.</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid2| Store logging disabled</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">2021/09/30 22:27:39 kid3| Squid Cache (Version 5.1): Terminated abnormally.</p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";min-height:15px"><br></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";min-height:15px"><br></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue";min-height:15px"><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">root@testhost:/squid# ls -l /squid/var/cache/</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">total 4</p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:"Helvetica Neue"">drwxr-xr-x 2 root root 4096 Sep 30 17:52 squid</p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 30, 2021 at 6:30 AM 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 9/30/21 2:49 AM, Praveen Ponakanti wrote:<br>
<br>
> I am trying to use the squid cache as an outbound HTTP/S proxy service<br>
> for our production network and would like to scale up the request per<br>
> sec by running it on multi-core systems. <br>
<br>
> I have searched up the archives and config docs, but couldn't find<br>
> anything more recent than the below on setting up SMP workers. <br>
> <a href="https://wiki.squid-cache.org/ConfigExamples/SmpCarpCluster" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/ConfigExamples/SmpCarpCluster</a><br>
> <a href="https://wiki.squid-cache.org/ConfigExamples/MultiCpuSystem" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/ConfigExamples/MultiCpuSystem</a><br>
<br>
The two old exotic configurations above are not what you should be<br>
starting with when thinking about SMP support in modern Squids. The best<br>
starting points I know about are<br>
<br>
* <a href="https://wiki.squid-cache.org/Features/SmpScale" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/Features/SmpScale</a><br>
* <a href="http://www.squid-cache.org/Doc/config/workers/" rel="noreferrer" target="_blank">http://www.squid-cache.org/Doc/config/workers/</a><br>
* <a href="http://www.squid-cache.org/Doc/config/cpu_affinity_map/" rel="noreferrer" target="_blank">http://www.squid-cache.org/Doc/config/cpu_affinity_map/</a><br>
* http(s)_port worker-queues option<br>
<br>
That Feature wiki page does not get many updates these days; if there is<br>
a conflict between information sources, the directive documentation in<br>
your squid.conf.documented may have more recent information.<br>
<br>
<br>
> * Can someone please let me know if the config examples in those docs<br>
> still apply to the latest version 5.1.<br>
<br>
I bet those use cases themselves do not apply well to your situation.<br>
<br>
<br>
> * Do we still need the combination of squid, frontend, backend.conf<br>
> files, or is it enabled simply with the "workers" line in the main<br>
> config file? <br>
<br>
The workers directive does not require multiple Squid instances (with<br>
multiple configuration files, etc.).<br>
<br>
<br>
> * When I attempt to run the squid server with "workers 4" in the<br>
> squid.conf, I get the following error (one for each kid) and the main<br>
> process does not bind to the "http_port 3128". I see several UDP ports<br>
> opened up for each kid process.<br>
<br>
> 2021/09/29 00:44:10 kid5| commBind Cannot bind socket FD 11 to [::]: (2) No such file or directory<br>
<br>
Unfortunately, I cannot tell exactly what went wrong based on that<br>
low-level message alone, but it could be a variant of [1]. If you cannot<br>
figure it out after checking [1] suggestions, consider sharing "squid<br>
-X" startup cache.log for analysis. There is<br>
<br>
[1]<br>
<a href="https://wiki.squid-cache.org/Features/SmpScale#Cannot_bind_socket_FD_NN_to_.5B::.5D:_.2813.29_Permission_denied" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/Features/SmpScale#Cannot_bind_socket_FD_NN_to_.5B::.5D:_.2813.29_Permission_denied</a><br>
<br>
The UDP ports you are seeing are probably for the internal DNS resolver<br>
which is not SMP-aware.<br>
<br>
<br>
> * Does anyone have recommendations on the maximum number of workers to<br>
> use on a 64 core host (assuming no other CPU intensive apps are running<br>
> on the same host). Caching is not a must for our initial deployment, so<br>
> we are fine disabling caching.<br>
<br>
28-30. See the following wiki section for the corresponding rules of<br>
thumb:<br>
<a href="https://wiki.squid-cache.org/Features/SmpScale#How_to_configure_SMP_Squid_for_top_performance.3F" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/Features/SmpScale#How_to_configure_SMP_Squid_for_top_performance.3F</a><br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
</blockquote></div>