Please could someone clarify how Mongrel behaves when uploading
files? I have an application with Apache which proxies to about 5
mongrels. Files are uploaded to the system from mobile PDAs using
GPRS, and the files are about 1 - 3 MB (so uploads take several
minutes). Will this mean that a Mongrel will be tied up serving the
upload for the duration of the upload? I know Rails is single
threaded, but I thought Mongrel wasn't. I expect (perhaps wrongly)
that Mongrel creates a new thread that handles the upload, streams it
to a TempFile (or something like it), then when it is ready, passes
the request on to Rails, which deals with it. That is what the trace
from the server looks like, as the upload actions take a few
milliseconds to complete. Or is it that for the duration of the
upload, that Mongrel will be blocked and won't service requests until
the upload is complete?
Thanks. Does that mean that a Mongrel will spawn a new thread to deal
with the file upload and still be able to service other requests in
the meantime?
I was at Railscon Europe and the guy from Twitter said that Mongrel
was single thread. Their config is set to only send one job at a time
to each mongrel using some of the newer Apache load balancing stuff.
So, tempfile or not, it may be a bit of a wait. He recommended passing
off long-running jobs to a daemon not sure how you'd do this for file
upload though.
I was at Railscon Europe and the guy from Twitter said that Mongrel
was single thread. Their config is set to only send one job at a time
to each mongrel using some of the newer Apache load balancing stuff.
So, tempfile or not, it may be a bit of a wait. He recommended passing
off long-running jobs to a daemon not sure how you'd do this for file
upload though.