liberapay / liberapay.com

Source code of the recurrent donations platform Liberapay
https://liberapay.com/
1.67k stars 215 forks source link

Apache restarts every hour #761

Open Changaco opened 7 years ago

Changaco commented 7 years ago

While investigating #760 I noticed in the Apache error log that it restarts every hour:

[Tue Oct 24 11:01:01.891887 2017] [mpm_prefork:notice] [pid 7082] AH00173: SIGHUP received. Attempting to restart
[Tue Oct 24 11:01:01.954036 2017] [so:warn] [pid 7082] AH01574: module wsgi_module is already loaded, skipping
[Tue Oct 24 11:01:01.981060 2017] [lbmethod_heartbeat:notice] [pid 7082] AH02282: No slotmem from mod_heartmonitor
[Tue Oct 24 11:01:01.981132 2017] [:warn] [pid 7082] mod_wsgi: Compiled for Python/2.7.10.
[Tue Oct 24 11:01:01.981136 2017] [:warn] [pid 7082] mod_wsgi: Runtime using Python/2.7.12.
[Tue Oct 24 11:01:01.983215 2017] [mpm_prefork:notice] [pid 7082] AH00163: Apache/2.4.27 (Amazon) mod_wsgi/3.5 Python/2.7.12 configured -- resuming normal operations
[Tue Oct 24 11:01:01.983229 2017] [core:notice] [pid 7082] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Oct 24 11:01:04.652043 2017] [:error] [pid 14225] Prepared the DB.
[Tue Oct 24 11:01:07.979887 2017] [:error] [pid 14225] Updated receiving amounts.
[Tue Oct 24 12:01:02.040395 2017] [mpm_prefork:notice] [pid 7082] AH00173: SIGHUP received. Attempting to restart
[Tue Oct 24 12:01:02.243190 2017] [so:warn] [pid 7082] AH01574: module wsgi_module is already loaded, skipping
[Tue Oct 24 12:01:02.263645 2017] [lbmethod_heartbeat:notice] [pid 7082] AH02282: No slotmem from mod_heartmonitor
[Tue Oct 24 12:01:02.263712 2017] [:warn] [pid 7082] mod_wsgi: Compiled for Python/2.7.10.
[Tue Oct 24 12:01:02.263716 2017] [:warn] [pid 7082] mod_wsgi: Runtime using Python/2.7.12.
[Tue Oct 24 12:01:02.265756 2017] [mpm_prefork:notice] [pid 7082] AH00163: Apache/2.4.27 (Amazon) mod_wsgi/3.5 Python/2.7.12 configured -- resuming normal operations
[Tue Oct 24 12:01:02.265770 2017] [core:notice] [pid 7082] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Oct 24 12:01:17.943633 2017] [:error] [pid 16543] Prepared the DB.
[Tue Oct 24 12:01:21.231877 2017] [:error] [pid 16543] Updated receiving amounts.

This isn't good for performance. For example the last two lines of each restart show that Payday.update_cached_amounts() is run every time, instead of once every 24 hours as it's supposed to.

Changaco commented 6 years ago

There's a possible explanation and fix in https://serverfault.com/questions/858050/elastic-beanstalk-log-rotation-causing-apache-restart