Recently a co-worker and I were stress testing an application in a Ubuntu Linux virtual machine when we ran into the open file limit which is 1024 files. Initially we tried to use the command ulimit to solve this problem, however every time we tried to increase the open file limit it would still end up being 1024. Then we realized that in order for a user to use ulimit to increase the open file limit, the limits needed to first be increased in the limits.conf file. Here is what solved the problem for us:
- Open the file in a text editor: sudo vi /etc/security/limits.conf
- Add two lines to increase the soft limit and hard limit for the user “myuser” before the #end tag
- myuser hard nofile 1800
- myuser soft nofile 1600
- You will need to reboot to make this change take effect
Now you should have a good sized file limit!