大网数据广告活动
服务器运维问答

exactly 90 seconds to restart apache httpd

· 52CE 我爱测

I have an openSUSE 13.1 VM (host runs Virtualbox 4.2.18, also on openSUSE 13.1) and restarting httpd (Apache/2.4.6) always takes 1.5 minute: foobar:~ # time /etc/init.d/apache2 restart redirecting to systemctl restart apache2.ser…

问题原文

原帖链接 · cherouvim · CC BY-SA 3.0

I have an openSUSE 13.1 VM (host runs Virtualbox 4.2.18, also on openSUSE 13.1) and restarting httpd (Apache/2.4.6) always takes 1.5 minute:

foobar:~ # time /etc/init.d/apache2 restart
redirecting to systemctl restart apache2.service

real    1m30.778s
user    0m0.004s
sys     0m0.000s

Immediately subsequent restart is normal (very fast):

foobar:~ # time /etc/init.d/apache2 restart
redirecting to systemctl restart apache2.service

real    0m1.023s
user    0m0.004s
sys     0m0.000s

5 minutes later the restart time goes again to exactly 90 seconds:

foobar:/tmp # time /etc/init.d/apache2 restart
redirecting to systemctl restart apache2.service

real    1m30.684s
user    0m0.000s
sys     0m0.000s

What I've looked for so far:

  • top while apache is restarting doesn't show a lot (~0% usage).
  • netstat also doesn't show any connections with the outside world.

Note that this is a VM which currently has 0 traffic and there are plenty of free GBs available in memory and disk.

I've also found that it's the "stop" part of the "restart" is what takes 90 seconds.

Any idea why this is happening or where should I look at next?

Edit: I found out that when stop takes 90 seconds I consistently get the following in /var/log/apache2/error_log:

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

已采纳解答

原帖链接 · cherouvim · CC BY-SA 3.0

After a lot of trial and error I found out that it's being caused by the php5 module which is being loaded in /etc/sysconfig/apache2. Removing it completelly stopped this behavior.

I need the php5 module though, so in order to mitigate this delay I've added the following in etc/apache2/server-tuning.conf:

GracefulShutdownTimeout 2

Now when the segfault occurs when stopping apache it only hangs for 2 seconds.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-02-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。