开发者

passenger won't spawn more than 6 instances despite passenger_max_pool_size = 30

I have some problems with passenger + nginx and hope someone might be able help me and direct me in the right direction.

I've set the passenger_max_pool_size to 30 but passenger never spawns more than 6 instances.

I'm loading a webpage that uses ajax to load 30 sub pages from the server but because passenger only spawns 6 instances they are queued. What makes me confused is that Waiting on global queue is 0 but I can 开发者_开发问答see in my browser that everything gets queued. When the first 6 ajax requests are done the next 6 starts loading.

What am I missing? :)

This is the output from passenger-status (I had about 24 requests in the browser waiting for response from the server when I checked this status)

----------- General information -----------
max      = 30
count    = 6
active   = 6
inactive = 0
Waiting on global queue: 0

----------- Domains -----------
/srv/rails/production/current: 
  PID: 28428   Sessions: 1    Processed: 42      Uptime: 5m 43s
  PID: 28424   Sessions: 1    Processed: 23      Uptime: 5m 43s
  PID: 28422   Sessions: 1    Processed: 7       Uptime: 5m 43s
  PID: 28420   Sessions: 1    Processed: 22      Uptime: 6m 0s
  PID: 28426   Sessions: 1    Processed: 39      Uptime: 5m 43s
  PID: 28430   Sessions: 1    Processed: 7       Uptime: 5m 43s

These are my passenger related settings in nginx.conf

http {
     passenger_root /opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.11;
     passenger_ruby /opt/ruby/bin/ruby;
     passenger_max_pool_size 30;


The key is to enable the global queue. The config option for the global queue is PassengerUseGlobalQueue on for Apache and passenger_use_global_queue on for Nginx.

I had the same issue with a few busy workers holding back requests that could be served by other workers. What is actually happening without the global queue is requests have already been allocated to a worker and they won't be reallocated to a free worker/slot. There is a slight performance overhead in enabling the global queue but I've found it has massively helped throughput overall.

Another thing to check is that you haven't set PassengerMaxInstancesPerApp (Apache) or passenger_max_instances_per_app (Nginx) to a value too low. The default value is 0 (no limit).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜