- 
                Notifications
    
You must be signed in to change notification settings  - Fork 433
 
Open
Description
I followed the instructions on the README and got my app working fine. However, I wanted to limit the max simultaneous requests that can be processed and cannot figure out how to make it work. I have tried setting passenger_max_instances and passenger_max_pool_size in the nginx conf file but the app still handles more than 2 requests at a time.
webapp.conf:
server {
    listen 80;
    server_name www.webapp.com;
    root /home/app/webapp/public;
    passenger_enabled on;
    passenger_user app;
    passenger_min_instances 2;
    passenger_max_instances 2;
    passenger_ruby /usr/bin/ruby3.2;
    client_max_body_size 50M;
}
passenger_max_pool_size 2;
I am using this to simulate simultaneous requests:
ab -c 10 -n 10 http://localhost:3001/
And I got this code on the RoR app:
def index
  pp "entering #{Time.now}"
  sleep 3
  pp "done #{Time.now}"
end
By looking at the logs, I see that all 10 requests start before any of them having finished.
I wonder if I am using the wrong config.
Metadata
Metadata
Assignees
Labels
No labels