首页 / 操作系统 / Linux / Linux系统级别能够打开的文件句柄的数file-max命令
简单的说, max-file表示系统级别的能够打开的文件句柄的数量, 而ulimit -n控制进程级别能够打开的文件句柄的数量.man 5 proc, 找到file-max的解释: file-max中指定了系统范围内所有进程可打开的文件句柄的数量限制(系统级别, kernel-level). (The value in file-max denotes the maximum number of file handles that the Linux kernel will allocate).当收到”Too many open files in system”这样的错误消息时, 就应该曾加这个值了.
可打开文件句柄数设置的太大, 有那些危害: If the file descriptors are tcp sockets, etc, then you risk using up a large amount of memory for the socket buffers and other kernel objects; this memory is not going to be swappable.