<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
{font-family:inherit;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"var\(--ff-mono\)";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>From:<o:p></o:p></p><p class=MsoNormal><a href="https://serverfault.com/a/717273/227456">https://serverfault.com/a/717273/227456</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='background:white;vertical-align:baseline'><span style='font-size:10.0pt;font-family:"inherit",serif;color:#232629'>2<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-bottom-alt:auto;background:white;vertical-align:baseline'><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'>The number of file descriptors is set in the systemd unit file. By default this is 16384, as you can see in </span><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>/usr/lib/systemd/system/squid.service</span><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'>.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-bottom-alt:auto;background:white;vertical-align:baseline'><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'>To override this, create a locally overriding </span><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>/etc/systemd/system/squid.service</span><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'> which changes the amount of file descriptors. It should look something like this:<o:p></o:p></span></p><p class=MsoNormal style='background:white;vertical-align:baseline'><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>.include /usr/lib/systemd/system/squid.service<o:p></o:p></span></p><p class=MsoNormal style='background:white;vertical-align:baseline'><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'><o:p> </o:p></span></p><p class=MsoNormal style='background:white;vertical-align:baseline'><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>[Service]<o:p></o:p></span></p><p class=MsoNormal style='background:white;vertical-align:baseline'><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>LimitNOFILE=65536<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-bottom-alt:auto;background:white;vertical-align:baseline'><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'>Do not edit the default file </span><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>/usr/lib/systemd/system/squid.service</span><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'>, as it will be restored whenever the package is updated. That is why we put it in a local file to override defaults.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-bottom-alt:auto;background:white;vertical-align:baseline'><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'>After creating this file, tell systemd about it:<o:p></o:p></span></p><p class=MsoNormal style='background:white;vertical-align:baseline'><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>systemctl daemon-reload<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-bottom-alt:auto;background:white;vertical-align:baseline'><span style='font-size:11.5pt;font-family:"inherit",serif;color:#232629'>and then restart squid.<o:p></o:p></span></p><p class=MsoNormal style='background:white;vertical-align:baseline'><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629;border:none windowtext 1.0pt;padding:0in'>systemctl restart squid</span><span style='font-size:10.0pt;font-family:"var(--ff-mono)",serif;color:#232629'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Eliezer<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> NgTech LTD <ngtech1ltd@gmail.com> <br><b>Sent:</b> Tuesday, August 31, 2021 6:11 PM<br><b>To:</b> Marcio B. <marciobacci@gmail.com><br><b>Cc:</b> Squid Users <squid-users@lists.squid-cache.org><br><b>Subject:</b> Re: [squid-users] Squid performance issues<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hey Marcio,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You will need to add a systemd service file that extends the current one with more FileDescriptors.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I cannot guide now I do hope to be able to write later.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>If anyone is able to help faster go ahead.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Eliezer<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span lang=HE dir=RTL>בתאריך יום ג׳, 31 באוג׳ 2021, 18:05, מאת</span><span dir=LTR></span><span dir=LTR></span><span dir=LTR></span><span dir=LTR></span> Marcio B. <span dir=RTL></span><span dir=RTL></span><span lang=HE dir=RTL><span dir=RTL></span><span dir=RTL></span></span><span dir=LTR></span><span dir=LTR></span><span dir=LTR></span><span dir=LTR></span><<a href="mailto:marciobacci@gmail.com">marciobacci@gmail.com</a>>:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>Hi,<br><br>I implemented a Squid server in version 4.6 on Debian and tested it for about 40 days. However I put it into production today and Internet browsing was extremely slow.<br><br>In /var/log/syslog I'm getting the following messages:<br><br>Aug 31 11:29:19 srvproxy squid[4041]: WARNING! Your cache is running out of filedescriptors<br><br>Aug 31 11:29:35 srvproxy squid[4041]: WARNING! Your cache is running out of filedescriptors<br><br>Aug 31 11:29:51 srvproxy squid[4041]: WARNING! Your cache is running out of filedescriptors<br><br><br>I searched the Internet, but I only found very old information and referring files that don't exist on my Squid Server.<br><br>The only thing I did was add the following value to the /etc/security/limits.conf file:<br><br>*-nofile 65535<br><br>however this did not solve.<br><br>Does anyone have any idea how I could solve this problem?<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Regards,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Márcio Bacci<o:p></o:p></p></div></div><p class=MsoNormal>_______________________________________________<br>squid-users mailing list<br><a href="mailto:squid-users@lists.squid-cache.org" target="_blank">squid-users@lists.squid-cache.org</a><br><a href="http://lists.squid-cache.org/listinfo/squid-users" target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a><o:p></o:p></p></blockquote></div></div></body></html>