Linux Open Files Limit

If you’ve ever gotten the “too many open files” error and tried to increase the open file limit for a certain user, you’ve probably seen the following solution on forums:

Edit the /etc/security/limits.conf file and add a new line to the end of the file like this:
myuser hard nofile 2048

Then you open up a new terminal session with myuser only to see that the limit hasn’t changed.

What gives?

I decided to add both hard and soft limits to the file, like this:

myuser hard nofile 2048
myuser soft nofile 2048

And that did the trick. Now every time I open a new terminal session I have a 2048 open file limit instead of the usual 1024.

I’m not sure if this is the best way to do it, though. If anybody knows a better way let me know.

Advertisements

One thought on “Linux Open Files Limit

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s