We ran benchmark program called h2load against several HTTP/2 servers available as OSS. h2load is also an OSS benchmark/stress test tool for HTTP/2 and SPDY protocols and part of nghttp2 project.
3 implementations were tested: h2o, trusterd and nghttp2 servers (nghttpd, tiny-nghttpd and nghttpx). We ran tests against standalone web servers as well as HTTP/2 reverse proxy forwarding to backend HTTP/1 link.
The machine we used for this tests is Thinkpad X240 (because it was a fastest machine we had at this particular time). Its CPU is Intel(R) Core(TM) i7-4600U CPU running at 2.10GHz with AES-NI. It has 2 cores and each has HT, so 4 logical cores in total. Total memory is 8GB.
We made following kernel parameter tuning:
bash -c 'echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range'
bash -c 'echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse'
bash -c 'echo 10000 > /proc/sys/net/core/somaxconn'
ulimit -n 65536
We use Ubuntu 14.10 amd64.
trusterd (from commit ab6b2fc664156a486154fbdf64527ef41a7a35ba) was built with qrintf (from commit e2ce1fed6dc72d238cd221d40f992beb1c87fd9d).
h2o (from commit de58bb3ccfb10a47a80f462db356208159660f8e) was built by just running make
without libuv and wslay.
We are not sure qrintf was used or not.
nghttp2 (from commit f1049a66e2cd59a022be95cfe9f29537e95ab144) was built with clang-3.5 and clang++-3.5 with libc++ (-stdlib=libc++)
trusterd and h2o build used gcc 4.9.1.
h2o configurations: cleartext, TLS, proxy, proxy-TLS
trusterd configurations: cleartext, TLS
nghttp2 configurations: See here
For reverse proxy tests, h2o was used as backend server. Its configuration is here.
Here is the test results. For each benchmark, we ran the test 3 times and picked up the median.
h2load -n2000000 -c500 -m100
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 269523 | 163631 |
nghttpd | 257174 | 140236 |
tiny-nghttpd | 294228 | 157339 |
trusterd | 259686 | 111046 |
h2load -n2000000 -c500 -m100 -w30 -W30
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 308311 | - |
nghttpd | 257502 | 195260 |
tiny-nghttpd | 292678 | 220162 |
trusterd | 259756 | 111486 |
h2load reported some errors with h2o 4k test case, so we abandoned this particular test. We reported this issue to h2o developers.
h2load -n2000000 -c500 -m100
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 227865 | 78333 |
nghttpd | 226716 | 80673 |
trusterd | 62362 | 44020 |
tiny-nghttpd was omitted from TLS test cases, because it lacks TLS support.
h2load -n2000000 -c500 -m100 -w30 -W30
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 266338 | - |
nghttpd | 227770 | 102708 |
trusterd | 65283 | 46401 |
Again h2load reported some errors with h2o 4k test case, so we abandoned this particular test.
trusterd was struggling with TLS. We did not investigate the reason, but it may be related to too short TLS record size which increases TLS overhead and hurts performance.
h2load -n1000000 -c100 -m100
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 74173 | 46603 |
nghttpx | 62405 | 40025 |
h2load -n1000000 -c100 -m100 -w30 -W30
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 75171 | 54294 |
nghttpx | 65785 | 49311 |
h2load -n1000000 -c100 -m100
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 72984 | 37114 |
nghttpx | 60222 | 35052 |
The backend HTTP/1 server was h2o.
h2load -n1000000 -c100 -m100 -w30 -W30
server | 6 bytes | 4K bytes |
---|---|---|
h2o | 72760 | 40704 |
nghttpx | 62404 | 41246 |
Again, the backend HTTP/1 server was h2o.
Thank you for the response. Using clang and libc++ showed noticeable performance gain. The table below is the results on cc3.8xlarge running Ubuntu 14.04 LTS.
The compiler versions used were: