From b41835f19b5c2099e4579f1dec5ecc2feb3f1e76 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 27 Apr 2015 21:23:01 +0900 Subject: [PATCH] h2load: Effectively disable flow control by setting large window size Previously h2load used default flow control window as described in HTTP/2 and SPDY specification. The window size is 64KiB, which is a bit small, and cannot utilize full server performance when response size is not too small. Basically, we do this kind of benchmarking test to measure server's throughput, and optimal performance. Smaller window certainly degrades performance even in local testing because server is so fast that it has to wait for WINDOW_UPDATE from h2load. To make default behaviour suitable for peak performance test, we decided to disable flow control in h2load by setting large enough window size. Most users used h2load without -w or -W options, so they were implicitly throttled by flow control and the result was affected by that negatively. Now flow control is disabled by default, the result may improve depending on the implementations. --- doc/h2load.h2r | 9 +++++++++ src/h2load.cc | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/h2load.h2r b/doc/h2load.h2r index ccefdd1d..10cc5d56 100644 --- a/doc/h2load.h2r +++ b/doc/h2load.h2r @@ -49,6 +49,15 @@ time for request The fraction of the number of requests within standard deviation range (mean +/- sd) against total number of successful requests. +FLOW CONTROL +------------ + +h2load sets large flow control window by default, and effectively +disables flow control to avoid under utilization of server +performance. To set smaller flow control window, use :option:`-w` and +:option:`-W` options. For example, use ``-w16 -W16`` to set default +window size described in HTTP/2 and SPDY protocol specification. + SEE ALSO -------- diff --git a/src/h2load.cc b/src/h2load.cc index 5daff7b0..37517d3e 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -69,7 +69,7 @@ namespace h2load { Config::Config() : data_length(-1), addrs(nullptr), nreqs(1), nclients(1), nthreads(1), - max_concurrent_streams(-1), window_bits(16), connection_window_bits(16), + max_concurrent_streams(-1), window_bits(30), connection_window_bits(30), no_tls_proto(PROTO_HTTP2), data_fd(-1), port(0), default_port(0), verbose(false) {} @@ -974,11 +974,13 @@ Options: -w, --window-bits= Sets the stream level initial window size to (2**)-1. For SPDY, 2** is used instead. + Default: )" << config.window_bits << R"( -W, --connection-window-bits= Sets the connection level initial window size to (2**)-1. For SPDY, if is strictly less than 16, this option is ignored. Otherwise 2** is used for SPDY. + Default: )" << config.connection_window_bits << R"( -H, --header=
Add/Override a header to the requests. -p, --no-tls-proto=