user938363
user938363

Reputation: 10350

PhusionPassenger:Why passenger still kills rails process after set passenger_min_instances = 1?

Our rails 3.2 app (deployed on passenger/nginx) uses gem ruote. The ruote worker (responsible for writing to database) needs to be kept running all the time for ruote to work. What we did is to keep min one instance running all the time by setting in nginx.conf:

passenger_min_instances 1;

However after about 5min idle time, the ruote worker stops responding. After restarting nginx, then ruote worker starts to work again. We don't know what passenger kills to cause the problem. enter code hereWhat else we need to set up in passenger to keep ruote worker running all the time?

Upvotes: 2

Views: 632

Answers (1)

Pravin Mishra
Pravin Mishra

Reputation: 8434

This specifies the minimum number of application processes that should exist for a given application. You should set this option to a non-zero value if you want to avoid potentially long startup times after a website has been idle for an extended period.

Please note that this option does not pre-start application processes during Nginx startup. It just makes sure that when the application is first accessed:

  1. at least the given number of processes will be spawned.

  2. the given number of processes will be kept around even when processes are being idle cleaned (see passenger_pool_idle_time).

If you want to pre-start application processes during Nginx startup, then you should use the passenger_pre_start directive, possibly in combination with passenger_min_instances. This behavior might seem counter-intuitive at first sight, but passenger_pre_start explains the rationale behind it.

Upvotes: 2

Related Questions