Skip to content

Commit 95d7612

Browse files
YINWEIHSUnfrankel
andauthored
docs: update xargs command and add #END to debug.yaml example (#10565)
* docs: Add #END to the `debug.yaml` basic snippet (#10549) * Update load-balancing.md modify load-balancing effect command line * Update rate-limiting.md * Update rate-limiting.md in zh * Update load-balancing.md in zh --------- Co-authored-by: Nicolas Fränkel <[email protected]>
1 parent 9d34d28 commit 95d7612

File tree

6 files changed

+6
-4
lines changed

6 files changed

+6
-4
lines changed

docs/en/latest/debug-mode.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ You can enable the basic debug mode by adding this line to your debug configurat
3636
```yaml title="conf/debug.yaml"
3737
basic:
3838
enable: true
39+
#END
3940
```
4041

4142
APISIX loads the configurations of `debug.yaml` on startup and then checks if the file is modified on an interval of 1 second. If the file is changed, APISIX automatically applies the configuration changes.

docs/en/latest/getting-started/load-balancing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ From `mock.api7.ai`:
8585
Let's generate 100 requests to test the load-balancing effect:
8686

8787
```shell
88-
hc=$(seq 100 | xargs -i curl "http://127.0.0.1:9080/headers" -sL | grep "httpbin" | wc -l); echo httpbin.org: $hc, mock.api7.ai: $((100 - $hc))
88+
hc=$(seq 100 | xargs -I {} curl "http://127.0.0.1:9080/headers" -sL | grep "httpbin" | wc -l); echo httpbin.org: $hc, mock.api7.ai: $((100 - $hc))
8989
```
9090

9191
The result shows the requests were distributed over the two services almost equally:

docs/en/latest/getting-started/rate-limiting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ You will receive an `HTTP/1.1 201 OK` response if the plugin was added successfu
5050
Let's generate 100 simultaneous requests to see the rate limiting plugin in effect.
5151

5252
```shell
53-
count=$(seq 100 | xargs -i curl "http://127.0.0.1:9080/ip" -I -sL | grep "503" | wc -l); echo \"200\": $((100 - $count)), \"503\": $count
53+
count=$(seq 100 | xargs -I {} curl "http://127.0.0.1:9080/ip" -I -sL | grep "503" | wc -l); echo \"200\": $((100 - $count)), \"503\": $count
5454
```
5555

5656
The results are as expected: out of the 100 requests, 2 requests were sent successfully (status code `200`) while the others were rejected (status code `503`).

docs/zh/latest/debug-mode.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ title: Debug Mode
2828
```
2929
basic:
3030
enable: true
31+
#END
3132
```
3233

3334
注意:在 APISIX 2.10 之前,开启基本调试模式曾经是设置 `conf/config.yaml` 中的 `apisix.enable_debug``true`

docs/zh/latest/getting-started/load-balancing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ curl -i "http://127.0.0.1:9180/apisix/admin/routes" -X PUT -d '
8585
我们生成 100 个请求来测试负载均衡的效果:
8686

8787
```shell
88-
hc=$(seq 100 | xargs -i curl "http://127.0.0.1:9080/headers" -sL | grep "httpbin" | wc -l); echo httpbin.org: $hc, mock.api7.ai: $((100 - $hc))
88+
hc=$(seq 100 | xargs -I {} curl "http://127.0.0.1:9080/headers" -sL | grep "httpbin" | wc -l); echo httpbin.org: $hc, mock.api7.ai: $((100 - $hc))
8989
```
9090

9191
结果显示,请求几乎平均分配给这两个上游服务:

docs/zh/latest/getting-started/rate-limiting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ curl -i "http://127.0.0.1:9180/apisix/admin/routes/getting-started-ip" -X PATCH
5050
我们同时生成 100 个请求来测试限速插件的效果。
5151

5252
```shell
53-
count=$(seq 100 | xargs -i curl "http://127.0.0.1:9080/ip" -I -sL | grep "503" | wc -l); echo \"200\": $((100 - $count)), \"503\": $count
53+
count=$(seq 100 | xargs -I {} curl "http://127.0.0.1:9080/ip" -I -sL | grep "503" | wc -l); echo \"200\": $((100 - $count)), \"503\": $count
5454
```
5555

5656
请求结果同预期一致:在这 100 个请求中,有 2 个请求发送成功(状态码为 `200`),其他请求均被拒绝(状态码为 `503`)。

0 commit comments

Comments
 (0)