passengerpassenger-nginx

passenger_min_instances not working with passenger ruby 2.3 docker


I am having the following Nginx config in passenger docker ruby phusion/passenger-ruby23 as below

server {
    # max body size (request + fileupload)
    client_max_body_size 5M;

    listen 80;
    server_name localhost;

    location ~* ^/assets/ {
      # if $uri, if not exist then '/404.html'
      try_files $uri =404;
      expires 1y;

      # when Last-Modified is present, ETag is discourage
      add_header ETag "";

      add_header Cache-Control public;
      add_header "Access-Control-Allow-Origin" "*";
      add_header "Access-Control-Allow-Methods" "GET";
    }

    # Nginx serve static assets
    root /home/app/avocado/public;

    passenger_min_instances 10;

    passenger_enabled on;
    passenger_user app;

    passenger_app_env staging;

    passenger_ruby /usr/bin/ruby2.3;
}

The web server runs just fine except that when I ran the command passenger-status I got the following output:

> passenger-status 

Using /usr/local/rvm/gems/ruby-2.3.8
Version : 6.0.4
Date    : 2020-05-28 10:25:03 +0000
Instance: feaXd0Zv (nginx/1.14.0 Phusion_Passenger/6.0.4)

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

----------- Application groups ------------

which means Passenger did not start with the min number of process I specified passenger_min_instances 10; in the above config.

Is there anyone experience with this issue?


Solution

  • Just got it working with the following config

    server {
      ...
      passenger_min_instances 10;
    }
    
    passenger_max_pool_size 15;
    passenger_pre_start http://localhost:80;