Created
August 1, 2019 06:27
-
-
Save membphis/f0e914f37cc23de64e7c9b2a07d96799 to your computer and use it in GitHub Desktop.
benchmark v0.6
This file contains hidden or 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@iZ8vbhq8oa47y8mscofouwZ apisix]# ./benchmark/run.sh | |
+ '[' -n '' ']' | |
+ worker_cnt=1 | |
+ mkdir -p benchmark/server/logs | |
+ mkdir -p benchmark/fake-apisix/logs | |
+ sudo openresty -p /root/apisix/benchmark/server | |
+ trap onCtrlC INT | |
+ sed -i 's/worker_processes [0-9]*/worker_processes 1/g' conf/nginx.conf | |
+ make run | |
mkdir -p logs | |
mkdir -p /tmp/cores/ | |
/usr/bin/openresty -p $PWD/ -c $PWD/conf/nginx.conf | |
+ sleep 3 | |
+ echo -e '\n\napisix: 1 worker + 1 upstream + no plugin' | |
apisix: 1 worker + 1 upstream + no plugin | |
+ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d ' | |
{ | |
"uri": "/hello", | |
"plugins": { | |
}, | |
"upstream": { | |
"type": "roundrobin", | |
"nodes": { | |
"127.0.0.1:80": 1 | |
} | |
} | |
}' | |
{"node":{"value":{"plugins":{},"uri":"\/hello","upstream":{"nodes":{"127.0.0.1:80":1},"type":"roundrobin"}},"createdIndex":10,"key":"\/apisix\/routes\/1","modifiedIndex":10},"prevNode":{"value":"{\"plugins\":{\"limit-count\":{\"time_window\":60,\"rejected_code\":503,\"count\":2000000000000,\"key\":\"remote_addr\"},\"prometheus\":{}},\"uri\":\"\\\/hello\",\"upstream\":{\"nodes\":{\"127.0.0.1:80\":1},\"type\":\"roundrobin\"}}","createdIndex":8,"key":"\/apisix\/routes\/1","modifiedIndex":8},"action":"set"} | |
+ sleep 1 | |
+ wrk -d 5 -c 16 http://127.0.0.1:9080/hello | |
Running 5s test @ http://127.0.0.1:9080/hello | |
2 threads and 16 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 705.56us 100.00us 5.93ms 91.37% | |
Req/Sec 11.37k 696.87 12.11k 75.49% | |
115398 requests in 5.10s, 459.24MB read | |
Requests/sec: 22629.91 | |
Transfer/sec: 90.06MB | |
+ sleep 1 | |
+ wrk -d 5 -c 16 http://127.0.0.1:9080/hello | |
Running 5s test @ http://127.0.0.1:9080/hello | |
2 threads and 16 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 695.73us 93.50us 3.12ms 89.80% | |
Req/Sec 11.54k 675.93 12.11k 82.35% | |
117025 requests in 5.10s, 465.72MB read | |
Requests/sec: 22945.70 | |
Transfer/sec: 91.32MB | |
+ sleep 1 | |
+ echo -e '\n\napisix: 1 worker + 1 upstream + 2 plugins (limit-count + prometheus)' | |
apisix: 1 worker + 1 upstream + 2 plugins (limit-count + prometheus) | |
+ curl http://127.0.0.1:9080/apisix/admin/routes/1 -X PUT -d ' | |
{ | |
"uri": "/hello", | |
"plugins": { | |
"limit-count": { | |
"count": 2000000000000, | |
"time_window": 60, | |
"rejected_code": 503, | |
"key": "remote_addr" | |
}, | |
"prometheus": {} | |
}, | |
"upstream": { | |
"type": "roundrobin", | |
"nodes": { | |
"127.0.0.1:80": 1 | |
} | |
} | |
}' | |
{"node":{"value":{"plugins":{"limit-count":{"time_window":60,"rejected_code":503,"count":2000000000000,"key":"remote_addr"},"prometheus":{}},"uri":"\/hello","upstream":{"nodes":{"127.0.0.1:80":1},"type":"roundrobin"}},"createdIndex":11,"key":"\/apisix\/routes\/1","modifiedIndex":11},"prevNode":{"value":"{\"plugins\":{},\"uri\":\"\\\/hello\",\"upstream\":{\"nodes\":{\"127.0.0.1:80\":1},\"type\":\"roundrobin\"}}","createdIndex":10,"key":"\/apisix\/routes\/1","modifiedIndex":10},"action":"set"} | |
+ sleep 3 | |
+ wrk -d 5 -c 16 http://127.0.0.1:9080/hello | |
Running 5s test @ http://127.0.0.1:9080/hello | |
2 threads and 16 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 0.85ms 183.35us 11.70ms 94.37% | |
Req/Sec 9.42k 249.55 9.78k 89.22% | |
95685 requests in 5.10s, 387.36MB read | |
Requests/sec: 18761.32 | |
Transfer/sec: 75.95MB | |
+ sleep 1 | |
+ wrk -d 5 -c 16 http://127.0.0.1:9080/hello | |
Running 5s test @ http://127.0.0.1:9080/hello | |
2 threads and 16 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 0.89ms 136.39us 4.75ms 86.12% | |
Req/Sec 9.04k 791.44 9.86k 75.49% | |
91772 requests in 5.10s, 371.52MB read | |
Requests/sec: 17996.27 | |
Transfer/sec: 72.85MB | |
+ sleep 1 | |
+ make stop | |
/usr/bin/openresty -p $PWD/ -c $PWD/conf/nginx.conf -s stop | |
+ echo -e '\n\nfake empty apisix server: 1 worker' | |
fake empty apisix server: 1 worker | |
+ sleep 1 | |
+ sed -i 's/worker_processes [0-9]*/worker_processes 1/g' benchmark/fake-apisix/conf/nginx.conf | |
+ sudo openresty -p /root/apisix/benchmark/fake-apisix | |
+ sleep 1 | |
+ wrk -d 5 -c 16 http://127.0.0.1:9080/hello | |
Running 5s test @ http://127.0.0.1:9080/hello | |
2 threads and 16 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 592.79us 55.46us 3.39ms 90.56% | |
Req/Sec 13.52k 124.69 13.83k 65.69% | |
137185 requests in 5.10s, 545.95MB read | |
Requests/sec: 26898.65 | |
Transfer/sec: 107.05MB | |
+ sleep 1 | |
+ wrk -d 5 -c 16 http://127.0.0.1:9080/hello | |
Running 5s test @ http://127.0.0.1:9080/hello | |
2 threads and 16 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 586.81us 74.09us 2.94ms 92.18% | |
Req/Sec 13.66k 1.38k 27.36k 99.01% | |
137276 requests in 5.10s, 546.31MB read | |
Requests/sec: 26921.89 | |
Transfer/sec: 107.14MB | |
+ sudo openresty -p /root/apisix/benchmark/fake-apisix -s stop | |
+ sudo openresty -p /root/apisix/benchmark/server -s stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment