4

I have installed apt-cacher-ng on my server. There are about 10 clients which will use this proxy to download the packages. Things were working fine since many days, however, all of sudden I started facing a lot of issues.

While downloading package, I'm facing following issue:

Err http://192.168.10.167 precise/main Sources
Unable to connect to 10.10.163.162:3142:*

Removing all contents from /var/cache/apt-cacher-ng and restarting server helped me to resolve the issue for a few hours. But issue starts popping up again after few hours.

I can see following errors in my /var/log/apt-cacher-ng/apt-cacher.err

Thu Feb 26 09:59:00 2015|known **data hit, don't write to...**
Thu Feb 26 09:59:00 2015|/var/cache/apt-cacher-ng/192.168.10.167/images/dists/ug/unstable/binary-i386/Packages.gz
Thu Feb 26 09:05:03 2015|gce.clouds.archive.ubuntu.com/ubuntu/dists/precise/universe/i18n/Translation-en storage error [503 Cache storage error - Too many open files]: **Too many open files**
Thu Feb 26 09:05:04 2015|Error creating pipe file descriptors

Can anyone please help me to resolve this issue.

JoKeR
  • 7,062
Tahir Rauf
  • 299
  • 3
  • 13

2 Answers2

3

you can increase limits like this:

edit file /etc/security/limits.conf

# vi /etc/security/limits.conf

Set program_user soft and hard limits as follows:

program_user soft nofile 4096
program_user hard nofile 10240

Save and close config file. Check limits, try this:

# su - program_user
$ ulimit -Hn
$ ulimit -Sn
1

For increasing the "maximum open files" limit of apt-cacher-ng, I just did the following.

In /etc/init.d/apt-cacher-ng, I added:

limit nofile 50000 50000

Please see following links for further details:

Melebius
  • 11,750
Tahir Rauf
  • 299
  • 3
  • 13