Archives

All posts for the month December, 2016

If you find that your /var/log/prosody/prosody.err log is being spammed with things like;

Failed to load accounts storage (‘cannot open /var/lib/prosody/xmpp%2eis/accounts/lunar.dat: Too many open files’) for user: lunar@xmpp.is

Then the solution is to increase your system’s open file limit in /etc/sysctl.conf, /etc/security/limits.conf and to create a new file called /etc/default/prosody with the limits. You will need to run nano, vi, etc as root or use sudo for this to work.

To do this

nano /etc/sysctl.conf

And add

fs.file-max = 999999

Run sysctl -p to apply the changes to /etc/sysctl.conf

Then also

nano /etc/security/limits.conf

And add

prosody hard nofile 999999
prosody soft nofile 999999

UPDATE 9/23/17

If you’re using systemd garbage you need to modify /etc/systemd/system.conf as well and add this parameter.

DefaultLimitNOFILE=999999

Then finally

nano /etc/default/prosody

And add

MAXFDS=999999

After you’ve done all this you shouldn’t have a problem and Prosody will be able to open more files. Hope this helps anyone that runs into the same issue!