#!/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=100000000 sysctl -w fs.file-max=10000000 ## 永久修改 echo "fs.nr_open = 10000000" >> /etc/sysctl.conf echo "fs.file-max = 11000000" >> /etc/sysctl.conf ## 临时修改最大打开文件数 ulimit -n 10240000 ## 查看当前打开的文件数 sysctl fs.file-nr
参考:http://www.ideawu.net/blog/archives/740.html