Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messure performance #1

Closed
matsumotory opened this issue Mar 24, 2014 · 7 comments
Closed

messure performance #1

matsumotory opened this issue Mar 24, 2014 · 7 comments

Comments

@matsumotory
Copy link
Owner

from https://gist.github.com/matsumoto-r/9702123.

@sawanoboly
Copy link
Sponsor

同環境でnginx 1.5のHTTP1.1

ENV

  • Server: Ubuntu12.04 on virtualbox (10.33.35.201)
# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 69
model name      : Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
stepping        : 1
microcode       : 0x19
cpu MHz         : 2762.728
cache size      : 6144 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good nopl pni monitor ssse3 lahf_lm
bogomips        : 5525.45
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
# nginx -V
nginx version: nginx/1.5.0
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --with-pcre-jit --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.5.0/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.5.0/debian/modules/nginx-dav-ext-module --add-module=/build/buildd/nginx-1.5.0/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.5.0/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.5.0/debian/modules/ngx_http_substitutions_filter_module
# ./build/default/weighttp -c 100 -n 100000 -k http://127.0.0.1:80/index.html
weighttp - a lightweight and simple webserver benchmarking tool

starting benchmark...
spawning thread #1: 100 concurrent requests, 100000 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 6 sec, 135 millisec and 940 microsec, 16297 req/s, 4137 kbyte/s
requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored
status codes: 100000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 25995015 bytes total, 23495015 bytes http, 2500000 bytes data

@matsumotory
Copy link
Owner Author

おおー、確かmruby-http2は10並列で14万でしたよね?100並列(-c 100 -m 100)という上記と同じ条件だとどうなりますか?

上記と同環境のmruby-http2の情報を下記の「ここから」以下にコピペ(refs: https://gist.github.com/matsumoto-r/9702123#comment-1197493 )

ここから↓


VirtualBoxでTLSなしをやってみた。146232 req/s

index.htmlをtmpfsにしてみたらちょっと(+30,000)早くなった。

ENV

  • Ubuntu12.04 on virtualbox
# cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 69
model name      : Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
stepping        : 1
microcode       : 0x19
cpu MHz         : 2762.728
cache size      : 6144 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good nopl pni monitor ssse3 lahf_lm
bogomips        : 5525.45
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

build

  • build mruby with cookbook[mruby]

Before build

apt-get install autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libevent-dev libjansson-dev libjemalloc-dev
mount -t tmpfs -o size=64m /dev/shm /var/tmp

Server

root_dir = "/var/tmp/www"  # tmpfs

s = HTTP2::Server.new({
  :port           => 8080,
  :document_root  => "#{root_dir}/htdocs",
  :server_name    => "mruby-http2 server",
  :tls => false,
})

s.run

Result

# ./h2load -n100000 -c10 -m10 http://127.0.0.1:8080/index.html
-t: warning: the number of threads is greater than hardware cores.
starting benchmark...
spawning thread #0: 10 concurrent clients, 100000 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 0 sec, 683 millisec and 844 microsec, 146232 req/s, 6997 kbytes/s
requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored
status codes: 100000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 4900370 bytes total, 160 bytes headers, 2500000 bytes data

ここまで↑

@sawanoboly
Copy link
Sponsor

こうなるねえ。

# ./h2load -n100000 -c100 -m100 http://127.0.0.1:8080/index.html
-t: warning: the number of threads is greater than hardware cores.
starting benchmark...
spawning thread #0: 100 concurrent clients, 100000 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 0 sec, 884 millisec and 519 microsec, 113055 req/s, 5413 kbytes/s
requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored
status codes: 100000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 4903700 bytes total, 1600 bytes headers, 2500000 bytes data

@matsumotory
Copy link
Owner Author

なるほどー。これらをみるとnginxの10倍くらいですかね。

@matsumotory
Copy link
Owner Author

Current commit: 49d213b

$ h2load -w30 -W30 -n5000000 -c100 -m 100 http://127.0.0.1:8080/index.html
starting benchmark...
spawning thread #0: 100 concurrent clients, 5000000 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 21 sec, 840 millisec and 430 microsec, 228933 req/s, 5815 kbytes/s
requests: 5000000 total, 5000000 started, 5000000 done, 5000000 succeeded, 0 failed, 0 errored
status codes: 5000000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 250069900 bytes total, 20067800 bytes headers, 110000000 bytes data

@matsumotory
Copy link
Owner Author

Local hello world benchmark: conccurency 30000

$ h2load -n1000000 -c30000 -m30000 http://127.0.0.1:8080/index.html
starting benchmark...
spawning thread #0: 30000 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 7 sec, 467 millisec and 749 microsec, 133909 req/s, 3656 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: 52588235 bytes total, 5958235 bytes headers, 22000000 bytes data

@matsumotory
Copy link
Owner Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants