Issue 19236: Add Tornado HTTP benchmark (original) (raw)

Created on 2013-10-12 19:15 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tornado_bench.patch pitrou,2013-10-12 19:15
tornado_bench2.patch pitrou,2013-10-20 19:31
Messages (8)
msg199613 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-12 19:15
Tornado 3.1.1 is compatible with Python 2.6, 2.7, 3.2 and upwards, which makes it a good candidate for a networking benchmark. Here is a patch adding a HTTP (server + client) benchmark. A trivial HTTP server is spawned which writes a sizable body in response to requests. HTTP clients then connect with a certain amount of concurrency and fetch the HTTP server's resource. (note: the patch omits the Tornado lib itself for readability)
msg199614 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2013-10-12 19:54
makes sense to me.
msg199615 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2013-10-12 19:58
+1. Does it give reasonably predictable timings?
msg199616 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-12 20:01
> +1. Does it give reasonably predictable timings? Yes. There is a small warmup phase at the beginning (the first few rounds are skipped). The benchmark eats 100% CPU on one core, mostly userspace (at least under Linux).
msg199662 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2013-10-13 07:30
Another thing: you are only using one thread for both the client and the server, and the app writes the entire content in one go (during one call to get()). Wouldn't it be more interesting to make the app's get() method asynchronous as well, so that each chunk actually gets passed separately? Otherwise, the fact that it's writing chunks wouldn't really contribute all that much to the benchmark. Or maybe split it up into two benchmarks, one that exercises the asynchronous client (as your current code does) and one that shifts more work to the server side? Not sure if it's worth it, but might be worth trying. I think it would cover two different use cases that way.
msg199716 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-13 15:00
> Wouldn't it be more interesting to make the app's get() method > asynchronous as well, so that each chunk actually gets passed > separately? That's a good point. I'll try to look into it. > Or maybe split it up into two benchmarks, one that exercises the > asynchronous client (as your current code does) and one that shifts more > work to the server side? Not sure if it's worth it, but might be worth > trying. I think it would cover two different use cases that way. You still need a client to exercise the server, and a server to exercise the client, so I'm not sure how to separate them (short of using an external utility, which would add dependencies).
msg200620 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-20 19:31
Attached patch makes the get() function asynchronous.
msg201173 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-24 19:59
New changeset 9a1136898539 by Antoine Pitrou in branch 'default': Close #19236: add a Tornado-based HTTP benchmark http://hg.python.org/benchmarks/rev/9a1136898539
History
Date User Action Args
2022-04-11 14:57:51 admin set github: 63435
2013-10-24 19:59:18 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: patch review -> resolved
2013-10-20 19:31:45 pitrou set files: + tornado_bench2.patchmessages: +
2013-10-14 19:27:35 pitrou set nosy: + georg.brandl
2013-10-13 15:00:24 pitrou set messages: +
2013-10-13 07:30:28 scoder set messages: +
2013-10-12 20:01:38 pitrou set messages: +
2013-10-12 19:58:02 scoder set messages: +
2013-10-12 19:54:19 gregory.p.smith set nosy: + gregory.p.smithmessages: +
2013-10-12 19:37:09 scoder set nosy: + scodercomponents: + Benchmarks
2013-10-12 19:15:31 pitrou create