long http connection blocks all other http requests to the web server

16 views
Skip to first unread message

John Merlino

unread,
May 17, 2017, 8:40:41 PM5/17/17
to Phusion Passenger Discussions

My Rails application has a specific action which allows a user to do address validation and subsequently update 10,000 records. This is a long process that takes several minutes. This is not an issue of slow database queries or bloat. It is just an intensive request that must be done.

The problem is it blocks all other users from accessing the system. When they try to access, their page just loads and loads until that intensive request finishes.

I am using Nginx and Phusion Passenger. If you know the two, Passenger is the application server that builds into Ngnix and forwards non-static requests to Rack, which is the Rails application.

I have been reading over the Design and Architecture of Passenger. I take note of Passenger core, its chief process:

The Passenger core is where most of the processing is done. The core keeps track of which application processes currently exist, and using load balancing rules, determines which process a request should be forwarded to. The core also takes care of application spawning: if it determines that having more application processes is necessary or beneficial, then it will make that happen. Process spawning is subject to user-configured limits: the core will never spawn more processes than a user-configured maximum.

It sounds like (even in the single-threaded free edition of Passenger) it is intelligent enough to spawn a new Rack (Rails) application to handle new http requests when another request is doing intensive work. But it does not seem to be working like this in my case. When I only have two users using the system, the other user cannot access the site when the other user is running the intensive task.

Right now I am using Passenger defaults. What configuration can I look for or change in Passenger in order to ensure new processes are spawned when a connection is in intensive use? 

Daniel Knoppel

unread,
May 18, 2017, 5:55:09 AM5/18/17
to Phusion Passenger Discussions
The first thing to do is to take the guesswork out and confirm what is actually happening. You can use passenger-status to see what the pool size is set to, what processes are being spawned, and how many of them are busy.

The default pool size is 6, so one request should not block everything (www.phusionpassenger.com/library/config/reference/).

- Daniel
Reply all
Reply to author
Forward
0 new messages