今天把系统升了一下级

最近两天系统总是崩溃,平均每天要重启两次,原因都是内存溢出。

刚开始无奈把 MaxClients 改小了,等了一个小时后登上去看负载是 30-40,tail access_log 是一堆爬虫。难道是搜索引擎们发现这个网站价值比较高,开始更频繁的访问了?

后来发现 apache2 缺省编译仍然是 prefork 模式。于是重新编译成了 worker,顺便 apache 升级到 2.2.4;PHP 也升级到最新的 5.2.1(仍然是 php5_module,而不是什么 FastCGI);最后再加上 eaccelerator 0.9.5。看看这个组合表现怎么样吧

评论

估计更不成。

php比较好的方式还是fastcgi+多进程。worker的多线程其实比较麻烦。

关于 PHP 的线程安全问题,有人说 "The default libraries are now all thread safe."

看看俺四月份的 boot 记录

reboot   system boot  2.6.8-2-686      Thu Apr 19 15:18
reboot   system boot  2.6.8-2-686      Wed Apr 18 17:33 
reboot   system boot  2.6.8-2-686      Wed Apr 18 11:56
reboot   system boot  2.6.8-2-686      Fri Apr 13 22:25
reboot   system boot  2.6.8-2-686      Thu Apr  5 21:41

目前看一切还很正常..