I recently upgraded to Ubuntu 16 and CouchDB 1.6. When my server gets hammered with a ton of connections, I get emfile
errors in the couch.log. I've seen these errors before and they appear to be related to the System Resource Limits mentioned at https://wiki.apache.org/couchdb/Performance. I believe my main problem is with ERL_MAX_PORTS
. I've already increased my ulimit to 40000 (via PAM) and added export ERL_MAX_PORTS=40000
to /etc/default/couchdb.
Ubuntu 16 uses systemd so I added Environment="ERL_MAX_PORTS=40000"
to the [Service]
section in /etc/systemd/system/multi-user.target.wants/couchdb.service, but this does not seem to work.
I even tried modifying /usr/bin/couchdb and adding env ERL_MAX_PORTS=40000
to the top of the script.
The only thing that appears to work is when I manually run couchdb from the command line, e.g. $ env ERL_MAX_PORTS=40000 && sudo /usr/bin/couchdb
. This is not an ideal solution and I would rather get this working with systemd.
I was previously running CouchDB 1.5 on Ubuntu 14 and increased my System Resource Limits (see https://wiki.apache.org/couchdb/Performance) to about 40000 and it was handling many connections without any issues.
Has anyone had any luck solving this problem on Ubuntu 16?