PassengerMaxInstances and PassengerMaxInstancesPerApp broken in Passenger+Apache 5.2.x (and 5.3)
Hello,
I am testing passenger 5.2.3 Open Source in my apps. I use PassengerMaxInstancesPerApp to '1'. However i see some apps are spawning more than 1 process by app. Is this expected in this version? According to the current docs, this should not be happen, i think
Apache 2.4 Centos 6 Compiled with passenger-install-apache2-module
Example:
----------- General information ----------- Max pool size : 30 App groups : 1 Processes : 3 Requests in top-level queue : 0 /home/xxxxx/apps/myapp (production): App root: /home/xxxxx/apps/myapp Requests in queue: 0
- PID: 31622 Sessions: 0 Processed: 12 Uptime: 53s CPU: 0% Memory : 50M Last used: 21s ago
- PID: 31666 Sessions: 0 Processed: 1 Uptime: 22s CPU: 0% Memory : 47M Last used: 22s ago
- PID: 31669 Sessions: 0 Processed: 0 Uptime: 22s CPU: 0% Memory : 11M Last used: 22s ago
Thanks.
Thanks for reporting and confirmed broken in the Apache integration mode (it does work in the Nginx integration mode).
Hello,
Ok, thanks. I suppose you will publish 2.3.4 with the fix, right?
Thanks.
I marked it hi prio, so it will be considered for the next release, yes.
@OnixGH is this issue fixed in Passenger 5.3.0?
Hi, Same here, is it fixed in Passenger 5.3.0? I do not see it in the changelog, so i suppose it is not?
Sorry, not yet, but we are working on it with high prio!
Hi.
Ok. Thanks for the update!
Hello, With passenger 5.3.2, i am still seeing this issue. Apache 2.4.33. PassengerMaxInstancesPerApp 1
And...
Version : 5.3.2
Date : 2018-06-19 11:44:59 +0200
Instance: (Apache/2.4.33 OpenSSL/1.0.2 Phusion_Passenger/5.3.2)
----------- General information -----------
Max pool size : 30
App groups : 1
Processes : 2
Requests in top-level queue : 0
----------- Application groups -----------
/home/xxxxxxx/ruby/xxxxxxxx (production):
App root: /home/xxxxxx/ruby/xxxxxxx
Requests in queue: 0
* PID: 2664512 Sessions: 0 Processed: 28 Uptime: 49s
CPU: 1% Memory : 50M Last used: 24s ago
* PID: 2664539 Sessions: 0 Processed: 1 Uptime: 25s
CPU: 0% Memory : 20M Last used: 25s ago
Process tree
xxxxxxx 2662663 0.4 5.8 195872 59132 ? Sl 11:43 0:01 | \_ Passenger AppPreloader: /home/xxxxxxxx/ruby/xxxxxxx
xxxxxxx 2664512 0.1 5.8 197920 59364 ? S 11:44 0:00 | | \_ Passenger AppPreloader: /home/xxxxxxxx/ruby/xxxxxxx (forking...)
xxxxxxx 2664539 0.0 5.8 197844 59156 ? S 11:44 0:00 | | \_ Passenger AppPreloader: /home/xxxxxxxx/ruby/xxxxxxxx (forking...)
Hello,
I have been testing passenger 5.3.4 with this result PassengerMaxInstancesPerApp 1 Apache 2.4.34
----------- General information ----------- Max pool size : 30 App groups : 1 Processes : 2 Requests in top-level queue : 0
----------- Application groups ----------- /home/xxxxxxxx/ruby/xxxxxxx (production): App root: /home/xxxxxx/ruby/xxxxxxx Requests in queue: 0
- PID: 3312977 Sessions: 1 Processed: 11 Uptime: 21s CPU: 1% Memory : 52M Last used: 5s ago
- PID: 3313014 Sessions: 1 Processed: 0 Uptime: 11s CPU: 0% Memory : 20M Last used: 10s ago
Process tree
\_ Passenger AppPreloader: /home/xxxxxx/ruby/xxxxx
\_ Passenger AppPreloader: /home/xxxxx/ruby/xxxxxx (forking...)
\_ Passenger AppPreloader: /home/xxxxxx/ruby/xxxxxx (forking...)
Thanks.
Hi,
Any change about the status of this issue? Do you need any adittional info?
Thanks.
Hi, we're having the same issue with Passenger Enterprise 5.2.3 (last version available for Debian 7) but with nginx, is this bug supposed to hit nginx installations too? We have passenger_max_instances 40 (max pool size 400) and we noticed today a single app with 213 processes... some of them had 0 sessions and 0 processes requests, not even sure why they are spawned, fortunately the global pool limit worked and capped the total number of process at 400 otherwise it probably would have kill the server.
I'm having trouble reproducing this, could either of you provide a complete config?
@CamJN Yes, I tried reproducing it locally with a simplified config (the production one is huge) and I managed to! I use the open source version locally though but it shows the bug with max_instances_per_app, which is probably the same.
Here's my nginx config:
passenger_max_instances_per_app 1;
passenger_max_pool_size 4;
server {
listen 80;
server_name my.dev.domain;
root /home/adrien/work/project/public;
passenger_app_env development;
passenger_enabled on;
}
And if I run ab to spam the server:
ab -n100 -c20 http://my.dev.domain/
I get 4 processes instead of 1:
$ sudo passenger-status
Version : 5.2.3
Date : 2018-08-28 18:43:22 +0200
Instance: gcKmJzzf (nginx/1.14.0 Phusion_Passenger/5.2.3)
----------- General information -----------
Max pool size : 4
App groups : 1
Processes : 4
Requests in top-level queue : 0
----------- Application groups -----------
/home/adrien/work/project (development):
App root: /home/adrien/work/project
Requests in queue: 0
* PID: 10713 Sessions: 0 Processed: 250 Uptime: 11s
CPU: 77% Memory : 112M Last used: 4s ago
* PID: 10737 Sessions: 0 Processed: 255 Uptime: 11s
CPU: 86% Memory : 111M Last used: 4s ago
* PID: 10763 Sessions: 0 Processed: 249 Uptime: 11s
CPU: 85% Memory : 111M Last used: 4s ago
* PID: 10803 Sessions: 0 Processed: 246 Uptime: 11s
CPU: 84% Memory : 111M Last used: 4s ago
I can't reproduce the bug with 5.3.4 so I guess this bug has been fixed in between for nginx too, but then you have a changelog issue as this bug was impacting nginx it seems. And unfortunately we can't upgrade in production as there's no package for Debian 7 since 5.2.3.
Can't we get a bit more packages compatibility here? Especially for the enterprise version...
Hello. I suppose the feedback needed is for nginx, right? I am using apache integration mode if anything needed.
Actually @r-a-c if you can provide an Apache config that reproduces the issue that'd be great. My config doesn't seem to trigger the problem.
@jarthod I'll see what I can do about a debian 7 package for you. Please email [email protected] with details on your usual installation method and I'll look into it.
@CamJN done
Version : 5.3.4 Date : 2018-08-30 11:27:36 +0200 Instance: (Apache/2.4.34) ----------- General information ----------- Max pool size : 30 App groups : 0 Processes : 0 Requests in top-level queue : 0
Then, with an include file, i set this:
<IfModule mod_passenger.c>
PassengerMaxPoolSize 30
PassengerMaxInstancesPerApp 1
PassengerMinInstances 0
</IfModule>
This app is an old app executed with an old ruby. These are the settings applied to this app
<IfModule mod_passenger.c>
PassengerBaseURI /
PassengerAppRoot /path
PassengerRuby /path-to-alternative-ruby
</IfModule>
Some envs, and no more configuration.
Near instantly, app spawns two slots.
/path (production): App root: path Requests in queue: 0
- PID: 2925468 Sessions: 0 Processed: 9 Uptime: 11s CPU: 1% Memory : 50M Last used: 6s ago
- PID: 2925484 Sessions: 0 Processed: 1 Uptime: 10s CPU: 0% Memory : 20M Last used: 9s ago
With the following config & Passenger 6, I cannot reproduce:
<IfModule mod_passenger.c>
PassengerMaxPoolSize 30
PassengerMaxInstancesPerApp 1
</IfModule>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/blog/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_passenger.c>
PassengerBaseURI /
PassengerAppRoot /var/www/blog/
PassengerMinInstances 0
</IfModule>
</VirtualHost>
I'm testing with ab -n100 -c20 http://localhost/ && passenger-status
And get output that indicates there is only one process:
Version : 6.0.0
Date : 2018-12-05 19:52:26 +0000
Instance: fy5hq360 (Apache/2.4.29 (Ubuntu) Phusion_Passenger/6.0.0)
----------- General information -----------
Max pool size : 30
App groups : 1
Processes : 1
Requests in top-level queue : 0
----------- Application groups -----------
/var/www/blog/ (production):
App root: /var/www/blog/
Requests in queue: 0
* PID: 19682 Sessions: 0 Processed: 401 Uptime: 59s
CPU: 0% Memory : 75M Last used: 0s ago
Perhaps check if Passenger 6 has solved your issue?