Stunnel,limits.conf

在看过很多客户的精彩build议并接受了Stunnel的答复之后,我发现这看起来像是我们的问题,但我在应用这个解决scheme时遇到了麻烦。

首先,ulimit是一个shell的东西,影响从shell(从我的理解)产生的进程。

因此,我正在检查/etc/security/limits.conf并添加以下行:

# stunnel resets 2011-03-03 kdh * hard nofile 65536 

并发出一个/etc/init.d/stunnel4重新启动,但我仍然看到了可怕的太多的连接消息:

 [admin@p2378442 ~]$ sudo tail -f /var/log/stunnel.log |grep "too many" 2011.03.03 13:43:07 LOG4[8461:3086272208]: Connection rejected: too many clients >=500) 2011.03.03 13:43:08 LOG4[8461:3086272208]: Connection rejected: too many clients >=500) 2011.03.03 13:43:08 LOG4[8461:3086272208]: Connection rejected: too many clients >=500) 

我是否正确应用了新的打开的文件限制? 我需要重新启动吗?

我想到了。 将“ulimit -n 65536”添加到/etc/init.d/stunnel4脚本中。