You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by we...@apache.org on 2023/11/29 06:45:35 UTC
(apisix) branch release/3.7 updated: docs: update xargs command in documentation (#10564)
This is an automated email from the ASF dual-hosted git repository.
wenming pushed a commit to branch release/3.7
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/release/3.7 by this push:
new 2a8ba6c5c docs: update xargs command in documentation (#10564)
2a8ba6c5c is described below
commit 2a8ba6c5c8006659065fc4f8bc2d9504be3e06e6
Author: Wei <63...@users.noreply.github.com>
AuthorDate: Wed Nov 29 14:45:27 2023 +0800
docs: update xargs command in documentation (#10564)
---
docs/en/latest/getting-started/load-balancing.md | 2 +-
docs/en/latest/getting-started/rate-limiting.md | 2 +-
docs/zh/latest/getting-started/load-balancing.md | 2 +-
docs/zh/latest/getting-started/rate-limiting.md | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/en/latest/getting-started/load-balancing.md b/docs/en/latest/getting-started/load-balancing.md
index 70755c27e..6f445bcda 100644
--- a/docs/en/latest/getting-started/load-balancing.md
+++ b/docs/en/latest/getting-started/load-balancing.md
@@ -85,7 +85,7 @@ From `mock.api7.ai`:
Let's generate 100 requests to test the load-balancing effect:
```shell
-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))
+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))
```
The result shows the requests were distributed over the two services almost equally:
diff --git a/docs/en/latest/getting-started/rate-limiting.md b/docs/en/latest/getting-started/rate-limiting.md
index a86f561a4..017c9409c 100644
--- a/docs/en/latest/getting-started/rate-limiting.md
+++ b/docs/en/latest/getting-started/rate-limiting.md
@@ -50,7 +50,7 @@ You will receive an `HTTP/1.1 201 OK` response if the plugin was added successfu
Let's generate 100 simultaneous requests to see the rate limiting plugin in effect.
```shell
-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
+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
```
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`).
diff --git a/docs/zh/latest/getting-started/load-balancing.md b/docs/zh/latest/getting-started/load-balancing.md
index 2923f8f51..2fdfd9270 100644
--- a/docs/zh/latest/getting-started/load-balancing.md
+++ b/docs/zh/latest/getting-started/load-balancing.md
@@ -85,7 +85,7 @@ curl -i "http://127.0.0.1:9180/apisix/admin/routes" -X PUT -d '
我们生成 100 个请求来测试负载均衡的效果:
```shell
-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))
+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))
```
结果显示,请求几乎平均分配给这两个上游服务:
diff --git a/docs/zh/latest/getting-started/rate-limiting.md b/docs/zh/latest/getting-started/rate-limiting.md
index 22f635fd5..459634893 100644
--- a/docs/zh/latest/getting-started/rate-limiting.md
+++ b/docs/zh/latest/getting-started/rate-limiting.md
@@ -50,7 +50,7 @@ curl -i "http://127.0.0.1:9180/apisix/admin/routes/getting-started-ip" -X PATCH
我们同时生成 100 个请求来测试限速插件的效果。
```shell
-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
+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
```
请求结果同预期一致:在这 100 个请求中,有 2 个请求发送成功(状态码为 `200`),其他请求均被拒绝(状态码为 `503`)。