Score:0

Nginx sometimes crash

US flag

Sometimes nginx randomly crashes (once every few months) Here's the log I got when I ran systemctl status nginx

    nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>
     Active: failed (Result: core-dump) since Tue 2023-01-24 11:09:29 UTC; 3h 4>
       Docs: man:nginx(8)
   Main PID: 265516 (code=dumped, signal=SEGV)
      Tasks: 0 (limit: 2351)
     Memory: 15.9M
     CGroup: /system.slice/nginx.service

Nov 25 08:52:52 ip-172-31-16-145 systemd[1]: Starting A high performance web se>
Nov 25 08:52:52 ip-172-31-16-145 systemd[1]: Started A high performance web ser>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Main process exited>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Killing process 631>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Killing process 631>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Failed with result >

I'm looking for a way to fix this or at least to restart nginx automatically when it happen.

The server is an EC2 Ubuntu instance on AWS.

Jaromanda X avatar
ru flag
you can see more of those messages, which may actually tell you why it `Failed with result`
Nicolas B. avatar
md
@JaromandaX How can I see that ? I havent found a log for this anywhere (and I restarted the nginx instance since).
Jaromanda X avatar
ru flag
I'm sure that error would be in one or more of the logs in `/var/log`
Score:0
us flag

Older nginx versions contain some issues that cause core dumps.

Check nginx changelog to see if your setup is related and update nginx to a recent version. That will likely fix the crashes.

Nicolas B. avatar
md
Updated to 1.22 (for some reason apt had 1.18 as the latest version but found a way to install a later one). I hope this will work.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.