您的位置:首页 > 运维架构 > Linux

调整Linux最大打开文件数

2017-07-29 18:47 211 查看
#!/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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: