nghttp2 に含まれるh2load が便利らしい
- http://hb.matsumoto-r.jp/entry/2016/01/14/114048
- https://nghttp2.org/
- https://github.com/nghttp2/nghttp2
- https://nghttp2.org/documentation/h2load-howto.html
gitからとってきてコンパイルする。
libev、libevent等はyumで適当にいれる。
h2load使う場合はconfigure --enable-app する。
が、libspdylayがないと怒られた。
yumにもなかったのでこれも別途取ってこようとしたけど
めんどくさくなったのでubuntuでやりなおす。
sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \ zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \ libjemalloc-dev cython python3-dev python-setuptools
autoreconf -i automake autoconf ./configure --enable-app make sudo make install
引数はabに似ている。
httpの場合はdefaultのprotocolがh2c(平文のHTTP/2)で、(clear textのc?)
通常のサーバにたいしては失敗するので-p http/1.1 をつける。
httpsの場合はhttp/2に対応していればh2で、対応していなければhttp/1.1で再接続してくれる。
h2load -c 100 -n 10000 -p http/1.1 http://myserver.example.com