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.