Apache uses 100% CPU or crashes every night

This is a common cause and happened to me with Plesk, after a update to Debian 8 with apache 2.4.

Apache 2.4 crashes with a segfault when you do multiple “apache2 reload” commands to reload settings.

This happens on Plesk every night, when it rotates the logs.

A quick view into “/var/log/apache2/error.log” reveals a segfault: “AH00060: seg fault or similar nasty error detected in the parent process”

Until this gets fixed (which seems to take ages) you could do one of these things:

  • Switch from the mpm_event worker to the mpm_prefork in your “Apache Web Server Settings”.
  • Increase your apache restart interval in Plesk “Home > Tools & Settings > Apache Web Server Settings”.
  • Replace “apache2 reload” with “apache2 restart” in the fileĀ “/etc/logrotate.d/apache2” andĀ “/etc/logrotate.d/mod_security”

Here are a few more pages with information about this topic: