Passenger Spawning Many Rack Applications
output passenger-memory-stats
----- Passenger processes -----
PID VMSize Private Name
-------------------------------
28572 207.4 MB ? Rack: /home/myapp/application
28580 207.0 MB ? Rack: /home/myapp/application
28588 206.0 MB ? Rack: /home/myapp/application
28648 206.5 MB ? Rack: /home/myapp/application
29005 23.0 MB ? PassengerWatchdog
29008 100.5 MB ? PassengerHelperAgent
29010 43.1 MB ? Passenger spawn server
29013 70.8 MB ? PassengerLoggingAgent
29053 202.0 MB ? Passenger ApplicationSpawner: /home/myapp/application
29105 202.3 MB ? Rack: /home/myapp/application
29114 202.3 MB ? Rack: /home/myapp/application
29121 202.3 MB ? Rack: /home/myapp/application
29130 202.3 MB ? Rack: /home/myapp/application
29138 202.3 MB ? Rack: /home/myapp/application
It looks like a lot of spawned processes ... this is an app that is currently in development and no one (I know it) hit it ...
output passenger-status
App root: /home/myapp/application
* PID: 29105 Sessions: 1 Processed: 0 Uptime: 15m 11s
* PID: 29114 Sessions: 1 Processed: 0 Uptime: 14m 0s
* PID: 29121 Sessions: 1 Processed: 0 Uptime: 14m 0s
* PID: 29130 Sessions: 1 Processed: 0 Uptime: 14m 0s
* PID: 29138 Sessions: 1 Processed: 0 Uptime: 14m 0s
First, is it okay?
Second, what are the possible reasons?
source to share
For anyone else with Rails freezing issue ... If you are running on a VPS with limited memory, check and make sure you tweak your max_pool so you don't have too many instances of the application for your system to handle. this is 6, which seems to be too much for memory related VPSs.
The docs on setting up the maximum pool: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#PassengerMaxPoolSize
source to share
It is possible that some process is preserved from earlier versions of your application. Our Rack app handles every point up to a specific version of our app.
95171 2491.8 MB 4.8 MB Rack: / Deployment / theapp / releases / 20120530013237
And there were multiple processes pointing to many different releases. Which leads me to the conclusion that they are left after restarting the application.
I thought maybe touching tmp / restart.txt instead of restarting apache has this effect. So I set: use_sudo to true and restarted with "run" # {try_sudo} / opt / local / apache2 / bin / apachectl graceful "instead, and the only Rack processes I can see are the ones that were just started.
source to share