![调整Linux最大打开文件数 调整Linux最大打开文件数](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
#!/bin/bash ## 文件数限制
ulimit -n
ulimit -Sn
ulimit -Hn ## fs.nr_open,进程级别
## fs.file-max,系统级别 ## 最大文件描述符
cat /proc/sys/fs/file-max
## 临时修改
sysctl -w fs.nr_open=
sysctl -w fs.file-max= ## 永久修改
echo "fs.nr_open = 10000000" >> /etc/sysctl.conf
echo "fs.file-max = 11000000" >> /etc/sysctl.conf ## 临时修改最大打开文件数
ulimit -n ## 查看当前打开的文件数
sysctl fs.file-nr
参考:http://www.ideawu.net/blog/archives/740.html