

Improving application throughput 9x with asynchronous responses in Rails 3 - aarongough
http://thingsaaronmade.com/blog/improving-application-throughput-900-percent-with-asynchronous-responses-in-rails-3.html

======
aarongough
As always I am more than happy to answer any questions. Although in this case
the credit really has to go to Ilya Grigorik and Mike Perham.

~~~
callmeed
I haven't had time to really dive in, so I'm a bit cloudy on what an
"asynchronous response" is and what the use cases are. Is it simply a way to
handle more concurrent requests with less resources?

Our apps do a lot of file uploads (images). Is that something that could
benefit?

~~~
aarongough
Basically in this case it means that the request is handing off execution to
other requests when it's doing something that requires waiting for an external
service. That service could be a database call, a HTTP request or even file
IO.

You hit the head on the nail with _" Is it simply a way to handle more
concurrent requests with less resources?"_ It makes _much_ more efficient use
of server resources than a normal blocking application.

Probably the most common use case is wrapping your database/API calls so
they're performed asynchronously. That way time normally spent waiting for the
database can be used to start serving other requests...

I've heard of people setting up asynchronous file uploads with Node.js, but
I'm not sure how to do it in this context. The simplest way to approach it may
be to make a separate Rack endpoint/application that deals with the upload.
That way you would minimize your overhead...

