On Fri, Jul 24, 2009 at 9:56 AM,
Brian<[email protected]> wrote:
> Hi -
>
> I'm evaluating Heroku for a web service that will be hit hard by a ton
> of iPhone users.
>
> As I understand it, each "dyno" handles one connection at a time.  So,
> N dynos means N connections at a time.

Kind of. The request path through heroku looks something like this:

Client -> Nginx -> Varnish -> Balancer -> Dyno

A dyno can process a single request at a time (1 dyno = 1 single
threaded Thin process). Multiple requests from a single client -- even
over a single keep-alive connection -- may be routed to different
dynos. Requests backlog at the balancer and are not sent to a dyno
until one is free.

> This rules out doing any form of keep-alive on read and chunked
> transfer on write since these would tie up a dyno for just one client
> connection.
>
> Is this understanding correct?

Chunked responses are thwarted by Thin's response buffering. The HTTP
response is not sent from your dyno until the entire response body has
been written, chunked encoding or not. There's also a fairly short (10
seconds IIRC) request timeout that makes long running responses non
feasible.

Keep-alive may still be useful. It reduces the number of connections
each client has to make to the Nginx layer. It doesn't give long lived
connections to a single dyno, however.

> I'm expecting multiple service calls in bursts (say 3 requests in a
> keep alive) and a single interested party would love to see the
> results of those requests (chunked transfer, long polling).
>
> I suppose if I cannot use keep alive or chunked transfer effectively
> then I'll have to revert to multiple service calls instead of keep
> alive and polling instead of chunked transfer or long polling.

That's right. Keep-alive can still reduce the number of connections
each client needs to establish but long lived / streaming responses
aren't possible with Heroku's architecture.

Thanks,
Ryan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to