3 ms·
It's important to note that with all these "X requests per second" benchmarks, they're almost never testing actual performance, but rather just less features. T
by notzorbo3 10y ago
It's important to note that with all these "X requests per second" benchmarks, they're almost never testing actual performance, but rather just less features. The architecture (event loop, forking, threading or any combination of those) also matters a lot, but they serve completely different purposes.
For example, they're using Apache as a reference point, but Apache does so much more than their code example. For one thing, you'll want to try disabling .htaccess support and static file serving so Apache doesn't actually hit the disk, like their code example doesn't.
I've found it trivial to make Python perform on the order of dozens of millions of requests per second, and I can keep scaling that basically indefinitely. But all I'm really testing, as is the given code example in the article, is a bit of looping and string manipulation.
- alexhultman 10y ago> I've found it trivial to make Python perform on the order of dozens of millions of requests per second [...] No, no you haven't. This is not a cluster of servers, this is one single thread serving 1 million responses per second. Inside of Node.js.
- lessclue 10y ago> I've found it trivial to make Python perform on the order of dozens of millions of requests per second Really curious. How did you achieve that? When you say "dozens of millions", it implies a minimum of 24+ million requests per second, which is quite unbelievable.
- notzorbo3 10y agoThrough forking + gevent and then sleeping in each request handler. Of course it measures nothing other than a whole bunch of while loops running in one fork per CPU waiting for just about nothing. In other words, I'm benchmarking "how much memory do I have", which is pointless. But it sure does scale!
- lessclue 10y agoTCP handshakes->HTTP parsing->Sleep->Response writing. Can the overhead added by these (and more) possibly produce 24+ million requests / sec on a commodity machine? Could you share some examples or snippets?
- mozumder 10y agothe way most python web apps work is they don't do the TCP handshake & http parsing, and leave that up to the front-end web server (nginx/apache/etc). Python only comes in via a fastcgi or wsgi proxy.
- tuyguntn 10y agoShow it to us