My Adventures in Coding

October 9, 2010

Ubuntu – Increasing the maximum number of open files

Filed under: Uncategorized — Brian @ 12:26 am

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!


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: