[BangPypers] Friendfeed's web server framework open sourced
harish.mallipeddi at gmail.com
Fri Sep 11 18:17:07 CEST 2009
On Fri, Sep 11, 2009 at 9:03 PM, Pradeep Gowda <pradeep at btbytes.com> wrote:
> On Fri, Sep 11, 2009 at 10:57 AM, Dhananjay Nene
> <dhananjay.nene at gmail.com> wrote:
> > I am curious about the objective .. to the best of my knowledge wsgi is
> > essentially blocking (unless my understanding is incorrect), whereas
> > is primarily non-blocking. So would you see any specific advantages of
> > deploying a wsgi app with tornado ?
The way FriendFeed guys have worded it makes it a bit confusing I guess. In
short, WSGI or not does not matter. You can write your web server the
regular multi-threaded way (one-thread-per-request) or you can make your
webserver do non-blocking I/O with an event loop and serve all incoming
requests within a single process (running a single thread).
The only problem with WSGI is it does not support (at least the spec does
not accommodate) long-live continuous streaming responses (the kind
FriendFeed would use in their COMET implementation to continuously send
updates to the client on-demand instead of polling). This is the only
limitation of using tornado with WSGI.
> The tornado doc says as much ..
> "Tornado comes with limited support for WSGI. However, since WSGI does
> not support non-blocking requests, you cannot use any of the
> asynchronous/non-blocking features of Tornado in your application if
> you choose to use WSGI instead of Tornado's HTTP server. "
> -- http://www.tornadoweb.org/documentation#wsgi-and-google-appengine
I don't even know why they even bring up AppEngine here. AppEngine will
spawn a new process on a random node in their cloud to serve a request to
your webapp. As an AppEngine user, you don't even have to worry about
scaling this kind of low-level infrastructure pieces - that's the whole
point of AppEngine! You push that responsibility to the cloud provider
(Google) and hope they do a good job.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the BangPypers