3 ms·
I wonder how it might compare to Tornado (http://www.tornadoweb.org/ http://www.tornadoweb.org/)
by markitechtMA 16y ago
I wonder how it might compare to Tornado (http://www.tornadoweb.org/ http://www.tornadoweb.org/)
- kwellman 16y agoHere's a blog post from several months ago: http://nichol.as/benchmark-of-python-web-servers http://nichol.as/benchmark-of-python-web-servers Gevent uses the http server built into libevent, which is written in C, so it's no surprise that it is fast.
- Vishnevskiy 16y agoI love Tornado personally, but I wanted to write synchronous code. Eventlet (the project that Gevent forked from) allows you to write hubs while gevent only supports the libevent hub. So I made http://github.com/vishnevskiy/greentornado http://github.com/vishnevskiy/greentornado to allow Eventlet to run on Tornado's IOLoop. Been working for a while in production with no issues. Would have made it for gevent though if I could since after reading the code of gevent and Eventlet I found that gevent's code base was much cleaner.
- weixiyen 16y ago^ This is really good stuff. Writing synchronous code for async programs really helps with maintainability.
- BarkMore 16y agoThe creators of Tornado recommend writing synchronous code for everything except "long" operations for which you have no control. Examples of these include long polling and requests to third party services. Requests to your local database are not long operations. If these requests are long operations, then you have a latency problem with your application. The Tornado people recommend running more instances of the application than CPUs to handle the short blocking requests to local databases and what not. Although it depends on what your app does, my guess is that typical applications written with this philosophy are mostly synchronous code.
- Vishnevskiy 16y agoWith eventlet and gevent you can write asynchronous that looks synchronous. Which is the point of greentornado. That being said we still use synchronous calls to our databases.