Abe_Stew
Posts: 18
Joined: Mon Mar 16, 2015 9:48 pm

Nginx freezing / crashing Pi 2

Mon Aug 14, 2017 9:55 am

I have had repeated problems when trying to host a Wordpress website using nginx with a Raspberry Pi 2. The website works perfectly fine with apache with no issues at all. However, when using nginx after around two days the website will stop loading and if I leave the Pi running for another half a day or so it will completely freeze up as well - with attempts to connect with ssh knocked back. I have tried nginx using raspbian images as well as PiPress and, now, YunoHost. As I am wanting to stick with using the latter I do not really have the option of switching back to apache as when using raspbian images. The website itself is tiny (32mb - and 95% of that is media files that are rarely touched), gets at most a few visitors a week, and issue occurs even when all plugins are deactivated. As there does not appear to be other users experiencing this issue - What steps can I take to try and find out what is causing the problem?

Abe_Stew
Posts: 18
Joined: Mon Mar 16, 2015 9:48 pm

Re: Nginx freezing / crashing Pi 2

Fri Sep 01, 2017 8:12 am

*bump*

Abe_Stew
Posts: 18
Joined: Mon Mar 16, 2015 9:48 pm

Re: Nginx freezing / crashing Pi 2

Sun Dec 17, 2017 1:57 pm

*bump again*

Still not resolved this issue. Upgraded to a Raspberry Pi 3 (also previously tried running the site using 2 different Raspberry Pi 2s I own), tried different sd cards, power supplies, and various images (PressPi, Raspbian Lite, YunoHost) again. However, any WordPress site I run using nginx results in the Raspberry Pi eventually freezing up and needing to pull the power cable to reboot. Any advice on how to troubleshoot this issue would be much appreciated.

Last entries in nginx error log are always 20 minutes before the Raspberry Pi froze up (based on not loading e-mails from JetPack):

2017/12/12 16:17:16 [info] 766#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:63
2017/12/12 16:17:16 [info] 766#0: [lua] init.lua:52: SSOwat ready
2017/12/13 22:17:16 [info] 765#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:63
2017/12/13 22:17:16 [info] 765#0: [lua] init.lua:52: SSOwat ready
2017/12/15 15:17:17 [info] 883#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:63
2017/12/15 15:17:17 [info] 883#0: [lua] init.lua:52: SSOwat ready
2017/12/15 21:01:54 [info] 896#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:63
2017/12/15 21:01:54 [info] 896#0: [lua] init.lua:52: SSOwat ready
2017/12/17 04:17:18 [info] 898#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:63
2017/12/17 04:17:18 [info] 898#0: [lua] init.lua:52: SSOwat ready

YunoHost messages log, syslog, and kern.log interestingly look like the pi was rebooting. Given it was 4.17am that definitely was not initiated by me:

Dec 17 03:09:01 YunoHost rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 17 03:10:31 2017 [try http://www.rsyslog.com/e/2007 ]
Dec 17 03:15:01 YunoHost rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 17 03:16:31 2017 [try http://www.rsyslog.com/e/2007 ]
Dec 17 03:17:01 YunoHost rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 17 03:18:31 2017 [try http://www.rsyslog.com/e/2007 ]
Dec 17 03:30:01 YunoHost rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 17 03:31:31 2017 [try http://www.rsyslog.com/e/2007 ]
Dec 17 03:39:01 YunoHost rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 17 03:40:31 2017 [try http://www.rsyslog.com/e/2007 ]
Dec 17 03:45:01 YunoHost rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 17 03:46:31 2017 [try http://www.rsyslog.com/e/2007 ]
Dec 17 04:17:04 YunoHost rsyslogd: [origin software="rsyslogd" swVersion="8.4.2" x-pid="412" x-info="http://www.rsyslog.com"] start
Dec 17 04:17:04 YunoHost kernel: [ 0.000000] Booting Linux on physical CPU 0x0
Dec 17 04:17:04 YunoHost kernel: [ 0.000000] Initializing cgroup subsys cpuset
Dec 17 04:17:04 YunoHost kernel: [ 0.000000] Initializing cgroup subsys cpu
Dec 17 04:17:04 YunoHost kernel: [ 0.000000] Initializing cgroup subsys cpuacct
[.... ]
[continues for hundreds of lines - nothing that looks like an error message]
Dec 17 04:17:08 YunoHost kernel: [ 13.052616] Bluetooth: BNEP filters: protocol multicast
Dec 17 04:17:08 YunoHost kernel: [ 13.052638] Bluetooth: BNEP socket layer initialized
Dec 17 04:17:21 YunoHost kernel: [ 26.143380] ip_tables: (C) 2000-2006 Netfilter Core Team
Dec 17 04:17:21 YunoHost kernel: [ 26.307410] nf_conntrack version 0.5.0 (14808 buckets, 59232 max)
Dec 17 04:17:21 YunoHost kernel: [ 26.690917] ip6_tables: (C) 2000-2006 Netfilter Core Team


php5-fpm.log shows nothing out of the ordinary - except it looks like it was also restarted again before the crash:

[16-Dec-2017 23:13:53] NOTICE: child 1203 stopped for tracing
[16-Dec-2017 23:13:53] NOTICE: about to trace 1203
[16-Dec-2017 23:13:53] NOTICE: finished trace of 1203
[17-Dec-2017 04:17:21] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

[17-Dec-2017 04:17:21] NOTICE: fpm is running, pid 1190
[17-Dec-2017 04:17:21] NOTICE: ready to handle connections
[17-Dec-2017 04:17:21] NOTICE: systemd monitor interval set to 10000ms

daemon.log:

Dec 16 21:16:58 YunoHost systemd[1]: Starting Cleanup of Temporary Directories...
Dec 16 21:16:58 YunoHost systemd[1]: Started Cleanup of Temporary Directories.
Dec 17 04:17:04 YunoHost systemd[1]: Mounted Configuration File System.
Dec 17 04:17:04 YunoHost systemd[1]: Started Apply Kernel Variables.
Dec 17 04:17:04 YunoHost systemd[1]: Started Create Static Device Nodes in /dev.
Dec 17 04:17:04 YunoHost systemd[1]: Starting udev Kernel Device Manager...
Dec 17 04:17:04 YunoHost fake-hwclock[102]: Sun 17 Dec 04:17:01 UTC 2017
Dec 17 04:17:04 YunoHost systemd-fsck[113]: e2fsck 1.42.12 (29-Aug-2014)
Dec 17 04:17:04 YunoHost systemd-fsck[113]: /dev/mmcblk0p2: clean, 88351/1870848 files, 942058/7592192 blocks
Dec 17 04:17:04 YunoHost systemd[1]: Started udev Kernel Device Manager.
Dec 17 04:17:04 YunoHost systemd[1]: Starting Copy rules generated while the root was ro...
Dec 17 04:17:04 YunoHost systemd[1]: Starting LSB: Set preliminary keymap...
Dec 17 04:17:04 YunoHost systemd[1]: Started Copy rules generated while the root was ro.
Dec 17 04:17:04 YunoHost systemd[1]: Starting Sound Card.
[...]
Dec 17 04:17:21 YunoHost metronome[913]: Starting Metronome XMPP Server: metronome.
Dec 17 04:17:21 YunoHost systemd[1]: Started LSB: Metronome XMPP Server.
Dec 17 04:17:21 YunoHost systemd[1]: Started The PHP FastCGI Process Manager.
Dec 17 04:17:21 YunoHost systemd[1]: Started A high performance web server and a reverse proxy server.

Return to “Troubleshooting”