程序中需要打开很多文件句柄,Linux有没有数量限制呢?
In Linux, you can change the maximum amount of open files.
The value is stored in :
$ cat /proc/sys/fs/file-maxsysctl is used to configure kernel parameters at runtime
# To increase open file limit to 500000, the change remain active until the next reboot $ sysctl -w fs.file-max=500000 # apply them permanently $ vi /etc/sysctl.conf # add the following line fs.file-max=500000 # Users will need to logout and login again for the changes to take effect, if you want to apply the limit immediately, you can use: $ sysctl -p