3 ms·
Thank you for explaining this. To add numbers to the explanation, a Python ThreadedHTTPServer can do about 1,500 qps on my machine whereas NGINX does 400k (and
by jart 4y ago
Thank you for explaining this. To add numbers to the explanation, a Python ThreadedHTTPServer can do about 1,500 qps on my machine whereas NGINX does 400k (and redbean does 1.1mqps). https://docs.google.com/presentation/d/1WEtSyz5oyTTGe0Fi2NhhUX6EX7HAE-GZe3RNWHInTiE/edit#slide=id.gd95bdc3681_0_13 https://docs.google.com/presentation/d/1WEtSyz5oyTTGe0Fi2Nhh... So one thing that's always helped Python be more secure and stable, is having NGINX as its advance guard which can store and forward requests. That way Python can do its job as quickly as possible. Because untrusted clients can do evil things, like open a bunch of really slow clients that send 1 byte every second. NGINX is outstanding at addressing that with its evio model. redbean does almost as good of a job. But poor little Python would need to preempt the entire server acquiring its GIL for each byte received, and that would cause a lot of contention.