Linux最大文件打开数查看和修改
2016-04-22 22:20
477 查看
$ulimit -a 命令显示
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024 --打开最大文件数量限制
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
#ulimit -n 65536 设置最大数,需要root权限,可以使用sudo -sH进入root shell
长期有效的修改办法:
编辑/etc/security/limits.conf,在“# End of file”上面添加如下:
* - nofile 65536
该语句表示:每一个用户的默认打开文件数是65536
编辑/etc/sysctl.conf,在最后一行添加如下:
fs.file-max = 65536
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024 --打开最大文件数量限制
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
#ulimit -n 65536 设置最大数,需要root权限,可以使用sudo -sH进入root shell
长期有效的修改办法:
编辑/etc/security/limits.conf,在“# End of file”上面添加如下:
* - nofile 65536
该语句表示:每一个用户的默认打开文件数是65536
编辑/etc/sysctl.conf,在最后一行添加如下:
fs.file-max = 65536
相关文章推荐
- Linux容器LXC学习之Namespace
- Linux下拷贝整个目录下的所有文件解决方案
- linux系统结构
- Linux下用条件变量实现多线程间生产者与消费者问题
- Ubuntu14.04+Texlive2014+LYX-Linux下LYX的中文配置方案
- CentOS6.4+MySQL-5.6.12 安装详解
- ZedBoard--(2)嵌入式Linux移植和BOA服务器的搭建
- DMA(Linux设备驱动程序)
- linux 命令
- CentOS 系统添加网卡
- CentOS从php5.3升级到php5.5
- linux中Makefile详细介绍
- Linux下MySQL5.1安装详解
- Linux for windows
- Linux的XServer
- iptables详解
- linux下查看一个进程的启动时间和运行时间
- linux命令大全
- linux
- CentOS 7安装gVim