如果不好改动内核, 可以在每次 boot 后修改
/proc/sys/kernel
下的下列文件也凑合:
file-max
file-nr
inode-max
inode-nr
以及可能的其它位置的类似配置文件
cat file-max 可以看现在的设定
echo "4096" > /proc/sys/kernel/file-max 可以设定新数值
当这些上限达到的时候, Linux 会出下列错误信息:
File table Overflow
Cannot load interpreter
而 FireBird BBS 系统, 由于 open 系统调用或者 fopen 函数失败
将导致下列错误现象:
版面列表中各版文章数目全变成零
apache httpd 异常 stopped
阅读文章看到黑屏幕或者乱七八遭的字符
等等...
: 在 yuhj (勇 梦回唐朝) 的大作中提到: 】
: 如果你用firebird应该看看它的doc/linux
: 当上站人数太多比如超过100的时候Linux的机器缺省的内核配置
: 就不行了.主要是文件打开数太小.解决办法如下:
: Because your BBS might be heavily accessed, it is wise to modify your kernel
: so that it becomes more robust. If your concurrent online users exceed 100,
: please perform the following steps:
: 1. Edit /usr/src/linux/include/linux/fs.h
: Increase NR_OPEN from 256 to 1024
: Increase NR_FILE from 1024 to 8192
: Increase NR_INODE from 3072 to 24576
: 2. Edit /usr/src/linux/include/linux/tasks.h
: Change NR_TASKS from 512 to 2048
: Change MAX_TASKS_PER_USER from (NR_TASKS/2) to (NR_TASKS/8)
: Change MIN_TASKS_LEFT_FOR_ROOT from 4 to 16
: 3. Recompile and install the new kernel and restart the machine
--
FROM 202.112.58.200