Ssl – Apache becomes unresponsive on Sundays

apache-2.2logrotatemagentossl

For some reason, most Sundays around 5-6AM local time Apache is not working properly. I can't find the reason, and I'm stuck troubleshooting.

I'm running Magento on Apache2 with an SSL certificate, and around that specific time random pages stop functioning resulting in no orders being placed. Sometimes it's the category page, sometimes it's the admin area.

I'm thinking it may be logrotating, but not sure how to troubleshoot further. Here's my Apache error log for the past two Sundays:

Jan 29th

/var/log/apache2/error.log.1:[Sun Jan 29 00:35:21 2012] [error] server reached MaxClients setting, consider raising the MaxClients setting

/var/log/apache2/error.log.1:[Sun Jan 29 00:39:44 2012] [error] [client 66.87.100.194] request failed: error reading the headers

/var/log/apache2/error.log.1:[Sun Jan 29 06:25:21 2012] [notice] Graceful restart requested, doing restart

— notice new log file

/var/log/apache2/error.log:[Sun Jan 29 06:25:24 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze1 with Suhosin-Patch mod_ssl/2.2.16 OpenSSL/0.9.8o configured — resuming normal operations

/var/log/apache2/error.log:[Sun Jan 29 06:26:00 2012] [notice] child pid 7301 exit signal Segmentation fault (11)

Jan 22nd

/var/log/apache2/error.log.2.gz:[Sun Jan 22 06:25:17 2012] [notice] Graceful restart requested, doing restart

— notice new log file

/var/log/apache2/error.log.1:[Sun Jan 22 06:25:22 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze1 with Suhosin-Patch mod_ssl/2.2.16 OpenSSL/0.9.8o configured — resuming normal operations

/var/log/apache2/error.log.1:[Sun Jan 22 16:26:11 2012] [notice] caught SIGTERM, shutting down

/var/log/apache2/error.log.1:[Sun Jan 22 16:26:12 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze1 with Suhosin-Patch mod_ssl/2.2.16 OpenSSL/0.9.8o configured — resuming normal operations

/var/log/apache2/error.log.1:[Sun Jan 22 16:26:14 2012] [notice] child pid 30367 exit signal Segmentation fault (11)

Best Answer

Not quite a programming problem, but there's this

server reached MaxClients setting, consider raising the MaxClients setting

which indicates Apachex is trying to take on more requests (at once) than it's configured for. Upping this number may be a good idea.

There's also these two lines

/var/log/apache2/error.log:[Sun Jan 29 06:25:24 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze1 with Suhosin-Patch mod_ssl/2.2.16 OpenSSL/0.9.8o configured -- resuming normal operations

/var/log/apache2/error.log.2.gz:[Sun Jan 22 06:25:17 2012] [notice] Graceful restart requested, doing restart

Which indicate someone is upgrading server packages, which may interfere with performance of the server itself.

ServerFault's a good place to ask a question like this.

A better place would be your ISP/IT-Department/Web-Host.