Why we are not able to change open files to unlimited in Linux ?

In this post, we will see an interesting thing when we are not able to change the open files to unlimited in Linux.

I. Error Message

[root@ngelinux001 ~]#  ulimit -n unlimited
bash: ulimit: open files: cannot modify limit: Operation not permitted
[root@ngelinux001 ~]#

 

II. Solution
This happens since there is restriction set on system with maximum files via the kernel parameter.

We can check this value and set it a little less than this.

[root@ngelinux001 ~]# sysctl -a | grep -i file-max
fs.file-max = 26158104

[root@ngelinux001 ~]# ulimit -n 655350
655350

[root@ngelinux001 ~]# ulimit -n 
655350

Now as we can see we have set it to a relatively very high value.

And now our purpose is solved having high number of open files.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments