Difference between Linux errno 23 and Linux errno 24

China☆狼群 提交于 2019-11-29 09:49:50

For 1) Both error codes are about the situation with too many opened files. EMFILE is too many files opened in your process. ENFILE is too many files opened in the entire system.

You can increase the maximum number of open files / file descriptors

sysctl -w fs.file-max=100000

Or open

/etc/sysctl.conf

and append/change fs.file-max to the number you need:

fs.file-max = 100000

Then run

sysctl -p

to reload the new settings

If you don't want to set system-wide FD (file-descriptor) limits, you can set the user-level FD limits.

You need to edit /etc/security/limits.conf file

And for user YOUR_USER, add these lines:

YOUR_USER soft nofile 4096
YOUR_USER hard nofile 10240

to set the soft and hard limits for user YOUR_USER.
Save and close the file.

To see the hard and soft limits for user YOUR_USER:

su - YOUR_USER

ulimit -Hn
ulimit -Sn
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!