[BangPypers] Friendfeed's web server framework open sourced
harish.mallipeddi at gmail.com
Fri Sep 11 19:34:21 CEST 2009
On Fri, Sep 11, 2009 at 10:32 PM, Anand Chitipothu <anandology at gmail.com>wrote:
> 2009/9/11 Dhananjay Nene <dhananjay.nene at gmail.com>:
> > 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 ?
> yes. quite a lot. In a multi-threaded server, as your concurrency
> increases thread context-switching overhead will become very high.
> Since Tornado uses epoll + callbacks it can handle thousands of
> Performance Results for helloworld:
> tornado: 1414 req/sec
> tornado + web.py: 802 req/sec
> lighttpd + fastcgi + web.py: 354 req/sec
> Tests were run using: ab -n 1000 -c 25 'http://0.0.0.0:8080/'
The results look good Anand. Although I would argue that using a helloworld
page is a little dubious here - it favors the epoll server. A good test will
be taking a more complicated page which involves quite a bit of processing.
With an epoll server, you would have to process each request extremely
quickly, be careful not to do any other blocking I/O (your DB client,
memcached client, etc should be non-blocking as well). If your callbacks are
not quick enough, you won't be processing events as fast as you would like
to and throughput will go down. This is why I think people resort to
spawning a few threads even with an epoll server instead of a single thread
(memcached also does the same in more recent versions again thanks to
facebook's contributions IIRC).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the BangPypers