正好90秒重新启动Apache httpd

我有一个openSUSE 13.1虚拟机(主机运行Virtualbox 4.2.18,也在openSUSE 13.1上),重新启动httpd(Apache / 2.4.6)总是需要1.5分钟:

foobar:~ # time /etc/init.d/apache2 restart redirecting to systemctl restart apache2.service real 1m30.778s user 0m0.004s sys 0m0.000s 

随即重启是正常的(非常快):

 foobar:~ # time /etc/init.d/apache2 restart redirecting to systemctl restart apache2.service real 0m1.023s user 0m0.004s sys 0m0.000s 

5分钟后,重新启动时间又回到正好90秒:

 foobar:/tmp # time /etc/init.d/apache2 restart redirecting to systemctl restart apache2.service real 1m30.684s user 0m0.000s sys 0m0.000s 

到目前为止,我所寻找的是:

  • 而Apache重新启动时不显示很多(〜0%的使用)。
  • netstat也不显示与外界的任何连接。

请注意,这是一个目前有0stream量的虚拟机,并有大量的可用内存和磁盘空间。

我也发现这是“重启”的“停止”部分是需要90秒。

任何想法,为什么发生这种情况或我应该看看下一步?

编辑 :我发现,当stop需要90秒时,我一直得到/var/log/apache2/error_log

 [core:notice] [pid 3179] AH00052: child pid 3203 exit signal Segmentation fault (11) 

经过大量的试验和错误,我发现它是由/etc/sysconfig/apache2加载的php5模块引起的。 完全删除它停止了这种行为。

我需要php5模块,所以为了减轻这个延迟,我在etc/apache2/server-tuning.conf添加了以下etc/apache2/server-tuning.conf

 GracefulShutdownTimeout 2 

现在,当停止Apache时发生段错误,它只会挂起2秒钟。