• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question How to configure a fixed process pool for NodeJS with Passenger

danimora

Basic Pleskian
I need that my NodeJS applications don't shut down automatically when a requests completes. But I am not able to reconfigure Passegner for that.

According to the passenger documentation:
"it spawns and shuts down application processes according to traffic. This allows it to use more resources during busy times, while conserving resources during idle times. For consistent performance, it is thus recommended that you configure a fixed process pool: telling Passenger to use a fixed number of processes, instead of spawning and shutting them down dynamically.

Run passenger start with --max-pool-size=N --min-instances=N, where N is the number of processes you want."

But I cannot find where to configure the start parameters for Passenger. I suspect that Nginxs is who starts Passenger processes but I don't see where to put the max-pool-size and min-instances parameters.

I tried to set the min-instances in a nginx directive that results seems a valid configuration but it does not work.
 
You can configure the max-pool-size in `/etc/nginx/conf.d/phusion-passenger.conf` like this:

```
passenger_max_pool_size 250;
```
 
Hello,
I have a problem setting the passenger configuration.
My /etc/nginx/conf.d/phusion-passenger.conf file looks like this:
passenger_root /usr/share/passenger/phusion_passenger/locations.ini;
passenger_log_file /var/log/passenger/passenger.log;
passenger_log_level 5;
max_app_processes = 100;
passenger_max_pool_size = 100;
passenger_min_instances = 1;
# Avoid downloading of sources or binary for ruby passenger_native_support.so
# after each nginx restart by default because of development packages
# or libruby.so.X.Y may be missed anyway.
# Ruby passenger_native_support.so is packaged for system ruby only.
passenger_env_var PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY 0;
passenger_env_var PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY 0;
Then I restart the app, and open a bunch of connections. But if I run passenger-status, I get
----------- General information -----------
Max pool size : 6
App groups : 1
Processes : 1
Requests in top-level queue : 0
----------- Application groups -----------
/var/www/vhosts/example.com/cloud.example.com (production):
App root: /var/www/vhosts/example.com/cloud.example.com
Requests in queue: 0
* PID: 16858 Sessions: 1 Processed: 169 Uptime: 1m 3s
CPU: 8% Memory : 101M Last used: 2s ago
I expect my "Max pool size" should be 100.... What do I do wrong?
 
Back
Top