Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29544

Nginx+Passenger: Passenger stop serving while spawning process during heavy traffic

$
0
0

I am configuring Nginx+Passenger for my RoR application. My question is related to passenger Spawn methods process and its behaviour.

Plateform
Ruby 2.4.1
Rails: 5.2
Web server: nginx/1.14.0
App server: Phusion Passenger 5.3.4
Server: EC2(m5.4xlarge)
domain: domain.com
app running at: domain.com/my_rails_application

nginx.conf

http
{
  passenger_max_pool_size 160;
  passenger_core_file_descriptor_ulimit 6000;
  passenger_pool_idle_time 300;
}

/sites-enable/default file
location /my_app {
proxy_set_header X-Real-IP  $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;

alias /path/to/my/project/current/public

passenger_enabled on;
passenger_app_env production;
passenger_min_instances 120;
passenger_max_requests 20000;
passenger_max_request_queue_size 0;

}

I have gone through: Spawn methods explained and Configuration & Optimization. I understand the spawn method & configuration details. Based on the configuration of our server, I set the below values.

passenger_max_pool_size = 160
passenger_min_instances = 120

As per my understanding, it has created 120 processes. During traffic, these 120 processes will process the incoming requests. If needed, then passenger will create more processes upto 160. While creating processes from P121 to P160, already created processes(P1 to P120) will continue to processed the incoming request. Correct me if I am missing anything here. Here sharing screenshots of our traffic and passenger's behavior.

Below one is expected as per our configuration. enter image description here

As traffic begins, it has started to spawn methods.

enter image description here

enter image description hereenter image description here

I think, the requests which are in the queue should be served by the process which are not processing any other requests. Is it correct? or I am missing something here. Any pointers will be appreciated.


Viewing all articles
Browse latest Browse all 29544

Trending Articles