Monday, January 2, 2012

Why did TellApart write TAFE instead of just using Tornado or any of the existing pure Python webservers?

It should be cleared up that TAFE stands for TellApart Frontend End and, as described in Mark Ayzenshtat's blog post (mentioned in the question,) is a framework built on the python coroutine library gevent. The decision In general to move from apache/mod_wsgi was made before I joined TellApart.?

TellApart used this blog post http://nichol.as/benchmark-of-py... to backup internal tests concluding in using gevent for the web server framework. Gevent is the lowest latency web server framework maintaining the smallest memory footprint of all frameworks profiled. A clear win/win.

Furthermore, gevent is built around a cooperative yielding mechanism to swap the lightweight "green" threads. A process can force itself to yield by performing a monkey patched blocking operation (e.g. socket operations) or explicitly calling gevent.sleep(0). This is important for TellApart's server infrastructure though because requests to the storage layer make up the vast majority of the latency for each request. Therefore to handle the large number of latency bound requests we receive, our server infrastructure must be nonblocking on socket operations which is a built in feature to gevent.

I haven't worked with Tornado but reading through some blog posts, non-blocking socket requests, namely database requests, block by default. This blog http://chart.io/blog/2011/06/10/... from chart.io mentions some python module hacking to accomplish a nonblocking mysql request. Thus, with some engineering the same behavior can be (sort of) accomplished by not blocking between sending a request and receiving the results although this still falls short of gevent's non-blocking socket operations.

Source: http://www.quora.com/Why-did-TellApart-write-TAFE-instead-of-just-using-Tornado-or-any-of-the-existing-pure-Python-webservers/answer/Ned-Rockson

reo chilis snow white and the huntsman snow white and the huntsman philip rivers 11 11 11 meaning miracle berry

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.