Ubuntu increase number of open files


By default number of open files per user in Ubuntu are 1024.

Use following command to check number of open files:

$ ulimit -n 



To increase number of open files add following lines in /etc/security/limits.conf :

@userName soft nofile 65535
@userName hard nofile 65535

where, userName is for which user (username) you want to increase the number of open files.

65535 is maximum number of files we can open in any Linux operating system, the number should not exceed 65535.

Next add following line in /etc/pam.d/common-session file.

session required pam_limits.so

After updating both files reboot your server/desktop and check for ulimit again with ulimit -n, it should be  65535.


2 comments on “Ubuntu increase number of open files

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 )

Connecting to %s