I’m having trouble uploading 2+ files simultaneously (from different
the upload page just hangs…
- ruby 1.8.4 (2005-12-24) [i686-linux]
- rails 1.1.4
- red hat el 4
- fcgi (0.8.7, 0.8.6.1)
- firefox 188.8.131.52
AddHandler fastcgi-script .fcgi
FastCGIConfig -minProcesses 2
I am having the same type of problems. I am running apache with 2
instances. What is happening is each fastcgi instance is blocking
file upload, so if 2 people are uploading files then both fastcgis are
blocked and no other web requests are processed. What is a solution to
Run more FCGI instances?
I believe there are also some (really excellent) solutions forming
I am running 2 FCGI instances and they use about 22MB a piece. I can’t
too many more without maxing out my 128MB VPS box. Anyone know how
37signals guys handle this with backpack, etc? I’ll keep an eye out on
I don’t know what the solution to this problem is, however I’m having
the exact same issues. If anyone has suggestions regarding how to
handle this with FCGI, I would also appreciate it!
I’m starting to feel like this is an issue that does not have a
which would mean that it would not possible to create a rails app with
multiple people uploading at the same time on anything less than a
box. Is this really true?
You need to add more dispatchers. You also need to make sure you can get
file there in a reasonable amount of time… some hosts have a timeout
fastcgi so if the upload takes too long, it will just disconnect the
The solution is to scale up. Rails requests are single-threaded.
The “big guys” are running lots of dispatchers on multiple machines. I
someone on here from Strongspace mentioned that they currently use 20
dispatchers, but don’t quote me on that.
People are working on plugins for Mongrel that offload the file uploads
different process and then pass the file to Rails when the upload is
don’t know how that’s coming but perhaps someone else can shed some
Beware: this is not just a problem with file uploads… it’s a problem
requests and Rails in general. If your machine can only handle 5
per second, then your 6th person is going to wait until someone else is
done. They requests will queue up and you will see terrible performance
unless you load-balance with multiple dispatchers.
Brian, thanks a ton for your excellent response!