When run apt-cacher-ng, and client will apper message like this and failed to download packages via apt-cacher-ng
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/curl/libcurl3-gnutls_7.81.0-1ubu
ntu1.15_arm64.deb 503 Connection closed, check DlMaxRetries [IP: 192.168.1.254 3142]
The reason is the system file open limit, it needs to modify it, it needs to modify file /etc/security/limits.conf and add those lines
apt-cacher-ng soft nofile 102400
apt-cacher-ng hard nofile 102400
If your system is heavy loading server, it can increase those numbers, and not existed the system cat /proc/sys/fs/nr_open setting.
Write the limit nofile to /etc/init.d/apt-cacher-ng doesn’t work for me.