4 ms·
The advantage here is the usage of Libevent which makes it only listen when a eventlet sends back a message. It's essentially using the same tech (event wise) a
by levigross 16y ago
The advantage here is the usage of Libevent which makes it only listen when a eventlet sends back a message. It's essentially using the same tech (event wise) as NGINX.
Because it's using event's it has not blocking IO. But is limited when the tasks are CPU bound
- deleted 16y ago[deleted]
- amix 16y agoEverything in nginx is non-blocking, almost nothing in Python is - this is a huge difference and this can be fatal for perfomance if all your libraries aren't non-blocking. An example: let's say you are executing an expensive query to MySQL in a non-blocking server and you are using the most popular libraries - - The problem with this is that this query will block your whole server and you won't be able to process any requests while this query is performed. If you want to take advantage of non-blocking then all your IO calls have to be non-blocking (like in node.js), else you don't gain much perfomance other than perfomance on hello world benchmarks - - and you may risk to decrease perfomance critically if _any_ of your IO calls are expensive. Gevent tries to solve this by monkey patching, but this solution is partial and it does not work with modules that use C extensions such as pylibmc (the fastest memcache library for Python) or MySQL-python (the most mature MySQL library for Python). I would love to see Python move into a non-blocking direction, but for this to happen then a huge change needs to be made and anything IO/network related has to be non-blocking... Which basically is Twisted and Twisted isn't that used, so I doubt the general Python community will move that much in the non-blocking direction.