Last active
August 29, 2015 13:57
-
-
Save matsumotory/9702123 to your computer and use it in GitHub Desktop.
mruby-http2 no-tls benchmark. GitHub: https://github.com/matsumoto-r/mruby-http2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Fedora19 on VMWare) | |
$ cat /proc/cpuinfo | |
processor : 0 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 60 | |
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz | |
stepping : 3 | |
microcode : 0x9 | |
cpu MHz : 3498.029 | |
cache size : 8192 KB | |
physical id : 0 | |
siblings : 1 | |
core id : 0 | |
cpu cores : 1 | |
apicid : 0 | |
initial apicid : 0 | |
fpu : yes | |
fpu_exception : yes | |
cpuid level : 13 | |
wp : yes | |
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase smep | |
bogomips : 6996.05 | |
clflush size : 64 | |
cache_alignment : 64 | |
address sizes : 40 bits physical, 48 bits virtual | |
power management: | |
processor : 1 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 60 | |
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz | |
stepping : 3 | |
microcode : 0x9 | |
cpu MHz : 3498.029 | |
cache size : 8192 KB | |
physical id : 2 | |
siblings : 1 | |
core id : 0 | |
cpu cores : 1 | |
apicid : 2 | |
initial apicid : 2 | |
fpu : yes | |
fpu_exception : yes | |
cpuid level : 13 | |
wp : yes | |
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase smep | |
bogomips : 6996.05 | |
clflush size : 64 | |
cache_alignment : 64 | |
address sizes : 40 bits physical, 48 bits virtual | |
power management: | |
$ free -m | |
total used free shared buffers cached | |
Mem: 7979 1063 6915 0 214 543 | |
-/+ buffers/cache: 305 7673 | |
Swap: 2079 0 2079 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ h2load -n1000000 -c100 -m100 http://127.0.0.1:8080/index.html | |
starting benchmark... | |
spawning thread #0: 100 concurrent clients, 1000000 total requests | |
progress: 10% done | |
progress: 20% done | |
progress: 30% done | |
progress: 40% done | |
progress: 50% done | |
progress: 60% done | |
progress: 70% done | |
progress: 80% done | |
progress: 90% done | |
progress: 100% done | |
finished in 2 sec, 970 millisec and 170 microsec, 336681 req/s, 8220 kbytes/s | |
requests: 1000000 total, 1000000 started, 1000000 done, 1000000 succeeded, 0 failed, 0 errored | |
status codes: 1000000 2xx, 0 3xx, 0 4xx, 0 5xx | |
traffic: 49003700 bytes total, 1600 bytes headers, 25000000 bytes data | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root_dir = "/usr/local/trusterd" | |
s = HTTP2::Server.new({ | |
:port => 8080, | |
:key => "#{root_dir}/ssl/server.key", | |
:crt => "#{root_dir}/ssl/server.crt", | |
:document_root => "#{root_dir}/htdocs", | |
:server_name => "mruby-http2 server", | |
# optional default | |
# :debug => false | |
# :tls => true | |
# :daemon => false, | |
:tls => false, | |
}) | |
s.run | |
# ./bin/mruby http2_server.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hello mruby-http2 world. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nghttp -v http://127.0.0.1:8080/index.html | |
[ 0.001] send SETTINGS frame <length=10, flags=0x00, stream_id=0> | |
(niv=2) | |
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100] | |
[SETTINGS_INITIAL_WINDOW_SIZE(4):65535] | |
[ 0.001] send HEADERS frame <length=48, flags=0x05, stream_id=1> | |
; END_STREAM | END_HEADERS | |
(padlen=0) | |
; Open new stream | |
:authority: 127.0.0.1:8080 | |
:method: GET | |
:path: /index.html | |
:scheme: http | |
accept: */* | |
accept-encoding: gzip, deflate | |
user-agent: nghttp2/0.4.0-DEV | |
[ 0.002] recv SETTINGS frame <length=5, flags=0x00, stream_id=0> | |
(niv=1) | |
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100] | |
[ 0.002] recv SETTINGS frame <length=0, flags=0x01, stream_id=0> | |
; ACK | |
(niv=0) | |
[ 0.003] (stream_id=1) :status: 200 | |
[ 0.003] (stream_id=1) server: mruby-http2 server | |
[ 0.003] recv HEADERS frame <length=16, flags=0x04, stream_id=1> | |
; END_HEADERS | |
(padlen=0) | |
; First response header | |
hello mruby-http2 world. | |
[ 0.003] recv DATA frame <length=25, flags=0x00, stream_id=1> | |
[ 0.003] recv DATA frame <length=0, flags=0x01, stream_id=1> | |
; END_STREAM | |
[ 0.003] send SETTINGS frame <length=0, flags=0x01, stream_id=0> | |
; ACK | |
(niv=0) | |
[ 0.003] send GOAWAY frame <length=8, flags=0x00, stream_id=0> | |
(last_stream_id=0, error_code=NO_ERROR(0), opaque_data(0)=[]) |
VirtualBoxのホストオンリーネットワーク越しにテスト。
ENV
- Server: Ubuntu12.04 on virtualbox (10.33.35.201)
- Client: Ubuntu12.04 on virtualbox (10.33.35.202)
Result
c# ./h2load -n1000000 -c10 -m10 http://10.33.35.201:8080/index.html
-t: warning: the number of threads is greater than hardware cores.
starting benchmark...
spawning thread #0: 10 concurrent clients, 1000000 total requests
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done
finished in 14 sec, 274 millisec and 632 microsec, 70054 req/s, 3352 kbytes/s
requests: 1000000 total, 1000000 started, 1000000 done, 1000000 succeeded, 0 failed, 0 errored
status codes: 1000000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 49000370 bytes total, 160 bytes headers, 25000000 bytes data
VMstat
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
2 0 0 102428 43508 38640 0 0 183 11 383 88 1 3 96 0
0 0 0 102368 43508 38640 0 0 0 0 19 47 0 0 100 0
1 0 0 102368 43508 38640 0 0 0 0 79 74 0 0 100 0
1 0 0 102248 43508 38640 0 0 0 0 12433 295 16 83 1 0
1 0 0 102248 43508 38640 0 0 0 0 12345 361 18 81 1 0
1 0 0 102308 43508 38640 0 0 0 0 11123 345 18 77 5 0
2 0 0 102248 43508 38640 0 0 0 0 12247 336 21 79 0 0
1 0 0 102248 43508 38640 0 0 0 0 12572 327 16 83 1 0
1 0 0 102248 43508 38640 0 0 0 0 12872 344 17 83 0 0
1 0 0 102308 43508 38640 0 0 0 0 12742 388 16 84 0 0
1 0 0 102248 43508 38640 0 0 0 0 13163 305 14 85 1 0
1 0 0 102308 43508 38640 0 0 0 0 12845 269 14 86 0 0
1 0 0 102248 43508 38640 0 0 0 0 12985 321 17 83 0 0
1 0 0 102248 43508 38640 0 0 0 0 12729 339 18 81 1 0
1 0 0 102248 43508 38640 0 0 0 0 12794 285 15 85 0 0
1 0 0 102248 43508 38640 0 0 0 0 12049 465 14 86 0 0
1 0 0 102308 43508 38640 0 0 0 0 13684 357 18 81 1 0
0 0 0 102248 43508 38640 0 0 0 0 2248 278 4 18 78 0
0 0 0 102248 43508 38640 0 0 0 0 16 36 0 0 100 0
ありがとうございます!nginxとか比較対象(厳密にはプロトコルが違うので比較にならないが)があると目安になってわかりやすそうですね。
誘導... matsumotory/mruby-http2#1
日本語でもOKです。ここだと通知とか無くて気付けなさそうですし。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
リクエスト数を10倍にしたらCPUを使いきっていたけど、これじゃクライアントの負荷込みになるな。