Phusion Passenger process stuck on (forking...) Rails
Asked Answered
W

1

17

Today I updated to the newest updated package for Nginx and Passenger. After the update, my app now has a (forking...) process that wasn't there before and doesn't seem to go away. Yet it is taking up memory and sudo /usr/sbin/passenger-memory-stats reports the following.

--------- Nginx processes ----------
PID   PPID  VMSize    Private  Name
------------------------------------
1338  1     186.0 MB  0.8 MB   nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
1345  1338  186.3 MB  1.1 MB   nginx: worker process
### Processes: 2
### Total private dirty RSS: 1.91 MB


---- Passenger processes -----
PID   VMSize    Private  Name
------------------------------
1312  378.8 MB  2.1 MB   Passenger watchdog
1320  663.8 MB  4.2 MB   Passenger core
1768  211.5 MB  29.0 MB  Passenger AppPreloader: /home/ubuntu/my-app
1987  344.1 MB  52.2 MB  Passenger AppPreloader: /home/ubuntu/my-app (forking...)
2008  344.2 MB  41.1 MB  Passenger AppPreloader: /home/ubuntu/my-app (forking...)
### Processes: 5
### Total private dirty RSS: 128.62 MB

I have the passenger_max_pool_size 2. sudo /usr/sbin/passenger-status reports that two are currently open. The server is receiving no hits at the moment besides me using the site.

Version : 5.3.0
Date    : 2018-05-14 00:41:05 +0000
Instance: ql2TTnkw (nginx/1.14.0 Phusion_Passenger/5.3.0)

----------- General information -----------
Max pool size : 2
App groups    : 1
Processes     : 2
Requests in top-level queue : 0

----------- Application groups -----------
/home/ubuntu/my-app (production):
  App root: /home/ubuntu/my-app
  Requests in queue: 0
  * PID: 1987    Sessions: 0       Processed: 1       Uptime: 3m 36s
    CPU: 0%      Memory  : 52M     Last used: 3m 36s ago
  * PID: 2008    Sessions: 0       Processed: 1       Uptime: 3m 35s
    CPU: 0%      Memory  : 41M     Last used: 3m 35s ago

Passenger never did this before the update and keeps the (forking...) always there now and it seems to have two apps running when it only needs one. I have searched their documents and know when it uses forking and when it doesn't and when it kills app automatically after a certain amount of time. Did they update something with the newest update that I missed in the docs? It seems that 2008 344.2 MB 89.4 MB Passenger AppPreloader: /home/ubuntu/my-app (forking...) always shows now and sometimes even has two of those when before the update I always had the process show without the (forking...).

Wachtel answered 14/5, 2018 at 0:45 Comment(7)
Just upgraded to 5.3.1 and seeing the same text. But as far as I can tell my apps are behaving like they should, and as they did before. And the processes without 'forking.....' goes away some time after starting the app.Zoa
@RogerErtesvag any idea how much longer afterwards? Mine still seems to be saying it after several hours.Jessalin
@patrick-davey mine still says it.Wachtel
@SamH. are the processes receiving requests (mine say they are..) so, maybe it really is all functioning as it should be. Does seem somewhat strange though. Seeing as you asked in May, I'm assuming everything is fine then? ;)Jessalin
Yea it functions, but I find it a tad bit annoying to have forking there the whole time is all, when it actually is the master process and not a fork lol.Wachtel
Seeing this on 5.3.4 as well, while it wasn't doing that for 5.3.2 for me. I'm pretty sure the change happened when upgrading from Ruby 2.4 to 2.5Mankind
Same here, all "Forking..." processed get detached from "AppPreloader" and keep hanging on the root, in logs: "Exception IOError (stream closed)"Duhon
K
10

This is normal for Passenger >= 5.3.

Source: I'm a dev at Phusion who works on Passenger.

Krilov answered 17/8, 2018 at 14:58 Comment(2)
Can you explain why though?Wachtel
We replaced the entire mechanism by which processes are started in Passenger, in preparation for some new functionality and the process renaming was left out. It never worked on some rubies, but could probably be added back in for mri without much difficulty if you want to look into it: github.com/phusion/passenger/tree/stable-5.3/src/agent/Core/… and github.com/phusion/passenger/blob/stable-5.3/src/… are good places to start.Krilov

© 2022 - 2024 — McMap. All rights reserved.