Score:0

out of memory leads to passenger shutdown and ensuing 502 error on nginx

cn flag

The following snippet from the nginx error logs

2023/04/21 06:48:21 [info] 120787#120787: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2023/04/21 06:48:23 [notice] 120791#120791: signal process started
[ N 2023-04-21 06:48:23.6978 120792/T1 age/Wat/WatchdogMain.cpp:1377 ]: Starting Passenger watchdog...
[ N 2023-04-21 06:48:23.7574 120798/T1 age/Cor/CoreMain.cpp:1340 ]: Starting Passenger core...
[ N 2023-04-21 06:48:23.7576 120798/T1 age/Cor/CoreMain.cpp:256 ]: Passenger core running in multi-application mode.
[ N 2023-04-21 06:48:23.7748 120798/T1 age/Cor/CoreMain.cpp:1015 ]: Passenger core online, PID 120798
[ N 2023-04-21 06:48:25.8551 120798/T5 age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 hours)
2023/04/21 06:48:26 [notice] 120820#120820: signal process started

[ N 2023-04-21 06:48:26.1902 120798/T6 age/Cor/CoreMain.cpp:670 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ N 2023-04-21 06:48:26.1903 120798/T1 age/Cor/CoreMain.cpp:1245 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ N 2023-04-21 06:48:26.1904 120798/Tb Ser/Server.h:901 ]: [ApiServer] Freed 0 spare client objects
[ N 2023-04-21 06:48:26.1904 120798/Tb Ser/Server.h:558 ]: [ApiServer] Shutdown finished
[ N 2023-04-21 06:48:26.1904 120798/T6 Ser/Server.h:901 ]: [ServerThr.1] Freed 0 spare client objects
[ N 2023-04-21 06:48:26.1904 120798/T6 Ser/Server.h:558 ]: [ServerThr.1] Shutdown finished
Out of memory!

indicates a memory issue leader to passenger being shut down. Running dmesg unfortunately, at this point in time do not show any particular clue.

How can the memory issue be tracked down?

Is there any way to restart the PassengerAgent without rebooting the server in production mode (in dev mode the pid was under the application's tmp/pids directory and could be relaunched via touch tmp/restart.txt but the passenger pid is not present in production and the relaunch command does not have any effect) ?

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.