To increase the maximum limit of open files on Ubuntu:
1) When logging in via GUI:
Modify the following (commented out) line in /etc/systemd/user.conf and /etc/systemd/system.conf:
(and add the desired upper limit)
2) When logging in via command line:
Add the following lines to /etc/security/limits.conf:
/user/ hard nofile /desired max number of open files/ /user/ soft nofile /desired max number of open files/
e.g.: andrey hard nofile 65535
3) Probably add to .bashrc and .bash_profile the line to change the upper limit for the number of open files:
ulimit -n /desired max number of open files/
Writing this out here, because the readily googlable solution (summarized in step 2 above) did not work on my laptop, and it wasn’t immediately apparent that it’s only suitable for command-line logins.
Dunno if step 3 is still necessary when using step 1.
P.S.: WTF? LJ just went ahead and added a tag to my post. Because I put a hash before DefaultLimitNOFILE. Ugh!