msg199613 - (view) |
Author: Antoine Pitrou (pitrou) *  |
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) *  |
Date: 2013-10-12 19:54 |
makes sense to me. |
|
|
msg199615 - (view) |
Author: Stefan Behnel (scoder) *  |
Date: 2013-10-12 19:58 |
+1. Does it give reasonably predictable timings? |
|
|
msg199616 - (view) |
Author: Antoine Pitrou (pitrou) *  |
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) *  |
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) *  |
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) *  |
Date: 2013-10-20 19:31 |
Attached patch makes the get() function asynchronous. |
|
|
msg201173 - (view) |
Author: Roundup Robot (python-dev)  |
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 |
|
|