aboutsummaryrefslogtreecommitdiffstats
path: root/test/bench/README.md
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-04-07 07:48:58 +1200
committerAldo Cortesi <aldo@corte.si>2018-04-16 09:19:14 +1200
commitb663a224a3655aab95a39eab2450f1f0e98997f2 (patch)
tree81e3f5445c0af49fbfe09a6bcbd3c89dc3e7904e /test/bench/README.md
parent5f74adc2df6d2a9452a9e3a6923fe05ba579e9e6 (diff)
downloadmitmproxy-b663a224a3655aab95a39eab2450f1f0e98997f2.tar.gz
mitmproxy-b663a224a3655aab95a39eab2450f1f0e98997f2.tar.bz2
mitmproxy-b663a224a3655aab95a39eab2450f1f0e98997f2.zip
Improve benchmarking
- The benchmark addon now manages setting up and tearing down the backend and traffic processes itself. - Use wrk instead of hey. I get more consistent results with this tool, and hey shows a strange tail-latency bump that seems artificial. - Make termination behaviour simpler. The bencmark revealed a bug where .done events were not called if the proxy was shut down by an addon.
Diffstat (limited to 'test/bench/README.md')
-rw-r--r--test/bench/README.md48
1 files changed, 9 insertions, 39 deletions
diff --git a/test/bench/README.md b/test/bench/README.md
index 05741c07..3d9e7ef7 100644
--- a/test/bench/README.md
+++ b/test/bench/README.md
@@ -1,7 +1,7 @@
-This directory contains a set of tools for benchmarking and profiling mitmproxy.
-At the moment, this is simply to give developers a quick way to see the impact
-of their work. Eventually, this might grow into a performance dashboard with
+This directory contains an addon for benchmarking and profiling mitmproxy. At
+the moment, this is simply to give developers a quick way to see the impact of
+their work. Eventually, this might grow into a performance dashboard with
historical data, so we can track performance over time.
@@ -9,48 +9,18 @@ historical data, so we can track performance over time.
Install the following tools:
- go get -u github.com/rakyll/hey
+ https://github.com/wg/wrk
+
go get github.com/cortesi/devd/cmd/devd
You may also want to install snakeviz to make viewing profiles easier:
pip install snakeviz
-In one window, run the devd server:
-
- ./backend
-
-
-# Running tests
-
-Each run consists of two files - a mitproxy invocation, and a traffic generator.
-Make sure the backend is started, then run the proxy:
-
- ./simple.mitmproxy
-
-Now run the traffic generator:
-
- ./simple.traffic
-
-After the run is done, quit the proxy with ctrl-c.
-
-
-# Reading results
-
-Results are placed in the ./results directory. You should see two files - a
-performance log from **hey**, and a profile. You can view the profile like so:
-
- snakeviz ./results/simple.prof
-
-
-
-
-
-
-
-
-
-
+Now run the benchmark by loading the addon. A typical invocation is as follows:
+ mitmdump -p0 -q --set benchmark_save_path=/tmp/foo -s ./benchmark.py
+This will start up the backend server, run the benchmark, save the results to
+/tmp/foo.bench and /tmp/foo.prof, and exit.