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@ppp-202 apisix]# gdb /usr/local/openresty/nginx/sbin/nginx /tmp/apisix_cores/core.21067 | |
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7 | |
Copyright (C) 2013 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. Type "show copying" | |
and "show warranty" for details. | |
This GDB was configured as "x86_64-redhat-linux-gnu". | |
For bug reporting instructions, please see: | |
<http://www.gnu.org/software/gdb/bugs/>... |
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
master_process on; | |
worker_processes 1; | |
error_log logs/error.log warn; | |
pid logs/nginx.pid; | |
worker_rlimit_nofile 20480; | |
events { |
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
rain@MBPro ~/Downloads/lua-resty-libr3 master ✔ | |
$ make | |
git clone -b 2.0.2-iresty https://github.com/iresty/r3.git | |
Cloning into 'r3'... | |
remote: Enumerating objects: 29, done. | |
remote: Counting objects: 100% (29/29), done. | |
remote: Compressing objects: 100% (19/19), done. | |
remote: Total 4308 (delta 14), reused 18 (delta 10), pack-reused 4279 | |
Receiving objects: 100% (4308/4308), 1.42 MiB | 548.00 KiB/s, done. | |
Resolving deltas: 100% (3041/3041), done. |
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 |
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
local json_encode = require("cjson.safe").encode | |
local clear_tab = require("table.clear") | |
local tostring = tostring | |
local type = type | |
local pairs = pairs | |
local cached_tab = {} | |
local _M = { | |
version = 0.1, |
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
{ | |
"node": { | |
"nodes": [{ | |
"value": { | |
"upstream": { | |
"nodes": { | |
"127.0.0.1:1980": 1 | |
}, | |
"type": "roundrobin" | |
}, |
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
=== TEST 1: set route(id: 1) | |
--- config | |
location /t { | |
content_by_lua_block { | |
local t = require("lib.test_admin").test | |
local code, body = t('/apisix/admin/routes/1', | |
ngx.HTTP_PUT, | |
[[{ | |
"methods": ["GET"], | |
"upstream": { |
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
# ./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 |
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
google cloud, CPU: 8core Memory: 8G |
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
机器配置:macbook pro 15寸,4core/8thread i7 cpu,内存 8G。 | |
先贴上单独用 wrk 压测结果(此时 nginx 的4个 worker 是处于 100% 工作状态)。 | |
$ wrk -d 10 -t 4 -c 1000 --latency http://test.com/ | |
Running 10s test @ http://test.com/ | |
4 threads and 1000 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 162.01ms 308.50ms 1.98s 84.93% | |
Req/Sec 10.61k 1.43k 15.45k 68.50% |