0

I want to deploy a ror3 application using nginx/passenger/rack on webfaction. Out of some reason uncached (or out of another reason, I am just guessing) requests to that site spawn multiple rack instances, I think unnecessarily so. Every subsequent request gets slower and slower and after some time I get 503s.

What could trigger such a behavior?

PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
19794 pts/6    Sl     0:00      1   345  5886  1940  0.0 PassengerNginxHelperServer/home/username/webapps/project/gems/gems/passenger-2.2.15 
19803 pts/6    Sl     0:00      3     2 13153  6732  0.1 Passenger spawn server
19819 ?        Ss     0:00      0   475  4760   548  0.0 nginx: master process /home/username/webapps/project/nginx/sbin/nginx -p /home/username/w
19827 ?        S      0:00      0   475  5056  1360  0.0 nginx: worker process
19876 pts/6    Sl     0:07      0     2 51245 41416  0.9 Rack: /home/username/webapps/project/rails_app
19907 ?        S      0:00      0   392  9615  1588  0.0 sshd: username@pts/8
19908 pts/8    Ss     0:00      6   695  4692  1900  0.0 -bash
20028 pts/6    Sl     0:07      0     2 51261 41432  0.9 Rack: /home/username/webapps/project/rails_app
20077 pts/6    Sl     0:08      0     2 51257 41424  0.9 Rack: /home/username/webapps/project/rails_app
20173 pts/6    Sl     0:08      0     2 51089 41280  0.9 Rack: /home/username/webapps/project/rails_app
20209 pts/6    Sl     0:07      0     2 51253 41484  0.9 Rack: /home/username/webapps/project/rails_app
20232 pts/6    Sl     0:08      0     2 51253 41416  0.9 Rack: /home/username/webapps/project/rails_app


Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
Jan
  • 103
  • 3

1 Answers1

0

Have a look at this parameter http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_passenger_max_instances_per_app_lt_integer_gt to limit the number of instance spawn by app.

this page: http://www.alfajango.com/blog/performance-tuning-for-phusion-passenger-an-introduction/ will also give you a rule of thumb to figure out what are the value for those parameters.

hellvinz
  • 2,886
  • 2
  • 16
  • 8