hf400159 commented on code in PR #7035: URL: https://github.com/apache/apisix/pull/7035#discussion_r872507020
########## docs/zh/latest/benchmark.md: ########## @@ -49,6 +49,29 @@ title: 压力测试  +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: Review Comment: ```suggestion 如果你想在你的服务器上运行基准测试,你需要同时启动两个 NGINX 实例并监听 `80` 端口。 你可以通过以下命令创建一个路由并添加已经启动的 NGINX 服务: ``` ########## docs/zh/latest/benchmark.md: ########## @@ -69,3 +92,47 @@ title: 压力测试 火焰图的采样结果:  + +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell Review Comment: ```suggestion ```bash ``` ########## docs/zh/latest/benchmark.md: ########## @@ -69,3 +92,47 @@ title: 压力测试 火焰图的采样结果:  + +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: Review Comment: ```suggestion 如果你想在本地服务器上运行基准测试,你需要同时启动两个 NGINX 实例并监听 `80` 端口,并安装 [wrk](https://github.com/wg/wrk/)。 你可以通过以下命令创建一个路由并添加已经启动的 NGINX 服务: ``` ########## docs/zh/latest/benchmark.md: ########## @@ -49,6 +49,29 @@ title: 压力测试  +如果您想在您的机器上运行基准测试,您应该同时运行另一个 Nginx 来监听 80 端口: Review Comment: ```suggestion 如果你想在你的服务器上运行基准测试,你需要同时启动两个 NGINX 实例并监听 `80` 端口。 你可以通过以下命令创建一个路由并添加已经启动的 NGINX 服务: ``` ########## docs/zh/latest/benchmark.md: ########## @@ -49,6 +49,29 @@ title: 压力测试  +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "methods": ["GET"], + "uri": "/hello", + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:80": 1, + "127.0.0.2:80": 1 + } + } +}' +``` + +然后运行 wrk: + +```shell +wrk -d 60 --latency http://127.0.0.1:9080/hello Review Comment: ```suggestion ./wrk -d 60 --latency http://127.0.0.1:9080/hello ``` ########## docs/zh/latest/benchmark.md: ########## @@ -49,6 +49,29 @@ title: 压力测试  +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "methods": ["GET"], + "uri": "/hello", + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:80": 1, + "127.0.0.2:80": 1 + } + } +}' +``` + +然后运行 wrk: + +```shell Review Comment: ```suggestion ```bash ``` ########## docs/zh/latest/benchmark.md: ########## @@ -69,3 +92,47 @@ title: 压力测试 火焰图的采样结果:  + +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "methods": ["GET"], + "uri": "/hello", + "plugins": { + "limit-count": { + "count": 999999999, + "time_window": 60, + "rejected_code": 503, + "key": "remote_addr" + }, + "prometheus":{} + }, + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:80": 1, + "127.0.0.2:80": 1 + } + } +}' +``` + +然后运行 wrk: + +```shell +wrk -d 60 --latency http://127.0.0.1:9080/hello +``` + +有关如何运行基准测试的更多参考,你可以查看此[PR](https://github.com/apache/apisix/pull/6136)和此[脚本](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)。 + +**注意**: 如果你想运行大量连接的基准测试,例如: Review Comment: ```suggestion :::tip 如果你想测试大量连接的基准测试,你可能需要更新 [`./conf/config-default.yaml`](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L242) 中的 **keepalive** 配置项,否则超过配置数量的连接将成为短连接。 如果你需要了解更多信息,请参考:[ngx_http_upstream_module] http://nginx.org/en/docs/http/ngx_http_upstream_module.html)。 ::: ``` ########## docs/zh/latest/benchmark.md: ########## @@ -69,3 +92,47 @@ title: 压力测试 火焰图的采样结果:  + +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "methods": ["GET"], + "uri": "/hello", + "plugins": { + "limit-count": { + "count": 999999999, + "time_window": 60, + "rejected_code": 503, + "key": "remote_addr" + }, + "prometheus":{} + }, + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:80": 1, + "127.0.0.2:80": 1 + } + } +}' +``` + +然后运行 wrk: + +```shell +wrk -d 60 --latency http://127.0.0.1:9080/hello +``` + +有关如何运行基准测试的更多参考,你可以查看此[PR](https://github.com/apache/apisix/pull/6136)和此[脚本](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)。 + +**注意**: 如果你想运行大量连接的基准测试,例如: + +```shell Review Comment: ```suggestion 你可以使用以下命令运行大量连接的基准测试: ```bash ``` ########## docs/en/latest/benchmark.md: ########## @@ -126,3 +126,15 @@ then run wrk: ```shell wrk -d 60 --latency http://127.0.0.1:9080/hello ``` + +For more reference on how to run the benchmark test, you can see this [PR](https://github.com/apache/apisix/pull/6136) and this [script](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01). + +**Note**: if you want to run the benchmark with a large number of connections, for example: + +```shell Review Comment: ```suggestion ```bash ``` ########## docs/zh/latest/benchmark.md: ########## @@ -69,3 +92,47 @@ title: 压力测试 火焰图的采样结果:  + +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "methods": ["GET"], + "uri": "/hello", + "plugins": { + "limit-count": { + "count": 999999999, + "time_window": 60, + "rejected_code": 503, + "key": "remote_addr" + }, + "prometheus":{} + }, + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:80": 1, + "127.0.0.2:80": 1 + } + } +}' +``` + +然后运行 wrk: + +```shell +wrk -d 60 --latency http://127.0.0.1:9080/hello Review Comment: ```suggestion ./wrk -d 60 --latency http://127.0.0.1:9080/hello ``` ########## docs/zh/latest/benchmark.md: ########## @@ -49,6 +49,29 @@ title: 压力测试  +如果您想在您的机器上运行基准测试,您应该同时运行另一个 Nginx 来监听 80 端口: Review Comment: Maybe that's okay too? ########## docs/zh/latest/benchmark.md: ########## @@ -69,3 +92,47 @@ title: 压力测试 火焰图的采样结果:  + +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "methods": ["GET"], + "uri": "/hello", + "plugins": { + "limit-count": { + "count": 999999999, + "time_window": 60, + "rejected_code": 503, + "key": "remote_addr" + }, + "prometheus":{} + }, + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:80": 1, + "127.0.0.2:80": 1 + } + } +}' +``` + +然后运行 wrk: Review Comment: ```suggestion 完成配置后,可以使用以下命令进行测试: ``` ########## docs/en/latest/benchmark.md: ########## @@ -126,3 +126,15 @@ then run wrk: ```shell wrk -d 60 --latency http://127.0.0.1:9080/hello ``` + +For more reference on how to run the benchmark test, you can see this [PR](https://github.com/apache/apisix/pull/6136) and this [script](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01). + +**Note**: if you want to run the benchmark with a large number of connections, for example: Review Comment: Please refer to the Chinese revision. ########## docs/en/latest/benchmark.md: ########## @@ -126,3 +126,15 @@ then run wrk: ```shell wrk -d 60 --latency http://127.0.0.1:9080/hello Review Comment: ```suggestion ./wrk -d 60 --latency http://127.0.0.1:9080/hello ``` ########## docs/zh/latest/benchmark.md: ########## @@ -69,3 +92,47 @@ title: 压力测试 火焰图的采样结果:  + +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "methods": ["GET"], + "uri": "/hello", + "plugins": { + "limit-count": { + "count": 999999999, + "time_window": 60, + "rejected_code": 503, + "key": "remote_addr" + }, + "prometheus":{} + }, + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:80": 1, + "127.0.0.2:80": 1 + } + } +}' +``` + +然后运行 wrk: + +```shell +wrk -d 60 --latency http://127.0.0.1:9080/hello +``` + +有关如何运行基准测试的更多参考,你可以查看此[PR](https://github.com/apache/apisix/pull/6136)和此[脚本](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)。 + +**注意**: 如果你想运行大量连接的基准测试,例如: + +```shell +./wrk -t200 -c5000 -d30s http://127.0.0.1:9080/hello +``` + +你可能需要更新 [conf/config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L242) 中的 **keepalive** 配置项。 + +超过配置数量的连接将成为短连接。更多文档可以参考:[ngx_http_upstream_module](http://nginx.org/en/docs/http/ngx_http_upstream_module.html) Review Comment: ```suggestion ``` ########## docs/zh/latest/benchmark.md: ########## @@ -49,6 +49,29 @@ title: 压力测试  +如果想在机器上运行基准测试,你应该同时运行另一个 NGINX 来监听 80 端口: + +```shell Review Comment: ```suggestion ```bash ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
