[squid-users] filedescriptors on debian/systemd

Matus UHLAR - fantomas uhlar at fantomas.sk
Tue Aug 2 16:23:38 UTC 2022


On 02.08.22 17:21, ngtech1ltd at gmail.com wrote:
>What's the bug exactly?

only 1k of fildescriptors by default. Even if hard limit is 1M (at least for 
login)

debian sysvinit script has hack that sets 64k fd limit, systemd unit file 
doesn't have this hack.

>The design of systemd is to enforce the FD limit.
>This is coming from the init 0 level of the design and due to this,
>squid cannot "patch" the kernel at runtime like any other process.
>The OS and systemd do not give any API to allow a request for"more FD".
>I assume that these days it makes sense for a request from the kernel or
>systemd to implement such a feature but I don't know if anyone have worked on this.

afaik that process can raise its soft limit up to hard limit level.

squid seems not to do this and debian 11 systemd unit files has no setting 
of limit at all.


>-----Original Message-----
>From: squid-users <squid-users-bounces at lists.squid-cache.org> On Behalf Of Matus UHLAR - fantomas
>Sent: Tuesday, 2 August 2022 16:54
>To: squid-users at lists.squid-cache.org
>Subject: [squid-users] filedescriptors on debian/systemd
>
>Hello,
>
>I have encountered Debian bug 934208:
>
>2022/07/28 16:40:53 kid1| With 1024 file descriptors available
>2022/07/29 06:50:18 kid1| WARNING! Your cache is running out of filedescriptors
>
>according to the bug report:
>
>"Under systemd the default is not to have any limitation at all."
>
>which seems not to be true, but:
>
>Unfortunately there are still some bugs that needs to be straightened
>out upstream for Squid to use the --with-filedescriptors value when
>there is *no* specific upper limit provided by the OS.
>
>
>limits when I log in (ssh or console) are 1024(soft) and 1048576 (hard) and
>yet squid starts with 1024 FDs.
>
>I have configured:
>
># cat /etc/systemd/system/squid.service.d/override.conf
>[Service]
>LimitNOFILE=65536
>
>and after reloading systemd:
>
># systemctl daemon-reload
>
>and restart squid it seems to work properly:
>
>2022/08/02 15:52:28 kid1| With 65536 file descriptors available
>
>
>does anyone encounter this bug?
>How do you fix it?

-- 
Matus UHLAR - fantomas, uhlar at fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
The 3 biggets disasters: Hiroshima 45, Tschernobyl 86, Windows 95


More information about the squid-users mailing list