标签:linux
要知道,在linux的世界里,一切皆文件.因此要实现大并发的第一步,修改linux系统的文件标识符限制数,也就是文件打开数量的限制
首先,内核级别的总限制 fs.file-max
man proc 里有这么一段话 /proc/sys/fs/file-max This file defines a system-wide limit on the number of open files for all processes. (See also setrlimit(2), which can be used by a process to set the per-process limit, RLIMIT_NOFILE, on the number of files it may open.) If you get lots of error messages about running out of file handles, try increasing this value: echo 100000 > /proc/sys/fs/file-max
查看限制数 fs.file-max [root@web01]# sysctl fs.file-max fs.file-max = 65535 修改限制数 [root@web01]# sysctl -w fs.file-max=6553500 fs.file-max = 6553500
/proc/sys/fs/file-nr 记录系统中fd的使用情况,已分配文件句柄的数目
[root@web01]# sysctl fs.file-nr fs.file-nr = 960 0 6553500
标签:linux
原文地址:http://itest.blog.51cto.com/3511959/1736599