This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 4eb587735 docs: fix unhealthy.failures attribute description of
api-breaker plugin (#7479)
4eb587735 is described below
commit 4eb587735dbe3f2a5084a1851abc58b20151bfcb
Author: haynesxiang <[email protected]>
AuthorDate: Tue Jul 19 13:54:20 2022 +0800
docs: fix unhealthy.failures attribute description of api-breaker plugin
(#7479)
* docs:fix unhealthy.failures attribute description of api-breaker plugin
* docs:fix unhealthy.failures attribute description of api-breaker plugin
* Update docs/zh/latest/plugins/api-breaker.md
Co-authored-by: Sylvia <[email protected]>
* Update docs/zh/latest/plugins/api-breaker.md
Co-authored-by: Sylvia <[email protected]>
Co-authored-by: xhq <[email protected]>
Co-authored-by: Sylvia <[email protected]>
---
docs/en/latest/plugins/api-breaker.md | 4 ++--
docs/zh/latest/plugins/api-breaker.md | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/en/latest/plugins/api-breaker.md
b/docs/en/latest/plugins/api-breaker.md
index 4469b5a31..2a519f7d3 100644
--- a/docs/en/latest/plugins/api-breaker.md
+++ b/docs/en/latest/plugins/api-breaker.md
@@ -46,7 +46,7 @@ In an unhealthy state, if the Upstream service responds with
a status code from
| break_response_headers | array[object] | False | |
[{"key":"header_name","value":"can contain Nginx $var"}] | Headers of the
response message to return when Upstream is unhealthy. Can only be configured
when the `break_response_body` attribute is configured. The values can contain
APISIX variables. For example, we can use
`{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`. |
| max_breaker_sec | integer | False | 300 | >=3
| Maximum time in seconds for circuit breaking.
|
| unhealthy.http_statuses | array[integer] | False | [500] | [500, ...,
599] | Status codes of Upstream to be considered unhealthy.
|
-| unhealthy.failures | integer | False | 3 | >=1
| Number of consecutive failures for the Upstream service to be considered
unhealthy.
|
+| unhealthy.failures | integer | False | 3 | >=1
| Number of failures within a certain period of time for the Upstream
service to be considered unhealthy.
|
| healthy.http_statuses | array[integer] | False | [200] | [200, ...,
499] | Status codes of Upstream to be considered healthy.
|
| healthy.successes | integer | False | 3 | >=1
| Number of consecutive healthy requests for the Upstream service to be
considered healthy.
|
@@ -80,7 +80,7 @@ curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H
'X-API-KEY: edd1c9f034335f
}'
```
-In this configuration, a response code of 500 or 503 three times in a row
triggers the unhealthy status of the Upstream service. A response code of 200
restores its healthy status.
+In this configuration, a response code of 500 or 503 three times within a
certain period of time triggers the unhealthy status of the Upstream service. A
response code of 200 restores its healthy status.
## Example usage
diff --git a/docs/zh/latest/plugins/api-breaker.md
b/docs/zh/latest/plugins/api-breaker.md
index 0e00517b2..5563fef9e 100644
--- a/docs/zh/latest/plugins/api-breaker.md
+++ b/docs/zh/latest/plugins/api-breaker.md
@@ -48,14 +48,14 @@ title: api-breaker
| break_response_headers | array[object] | 可选 | 无 |
[{"key":"header_name","value":"can contain Nginx $var"}] |
不健康返回报文头,这里可以设置多个。该字段仅在 `break_response_body` 被配置时生效。这个值能够以 `$var` 的格式包含 APISIX
变量,比如 `{"key":"X-Client-Addr","value":"$remote_addr:$remote_port"}`。 |
| max_breaker_sec | integer | 可选 | 300 | >=3
| 最大熔断持续时间 |
| unhealthy.http_statuses | array[integer] | 可选 | {500} | [500, ...,
599] | 不健康时候的状态码 |
-| unhealthy.failures | integer | 可选 | 3 | >=1
| 触发不健康状态的连续错误请求次数 |
+| unhealthy.failures | integer | 可选 | 3 | >=1
| 在一定时间内触发不健康状态的异常请求次数 |
| healthy.http_statuses | array[integer] | 可选 | {200} | [200, ...,
499] | 健康时候的状态码 |
| healthy.successes | integer | 可选 | 3 | >=1
| 触发健康状态的连续正常请求次数 |
## 启用方式
这是一个示例,在指定的路由上启用 `api-breaker` 插件。
-应答 500 或 503 连续 3 次,触发熔断。应答 200 连续 1 次,恢复健康。
+在一定时间内应答 500 或 503 达到 3 次,触发熔断。应答 200 连续 1 次,恢复健康。
```shell
curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H 'X-API-KEY:
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
@@ -85,7 +85,7 @@ curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H
'X-API-KEY: edd1c9f034335f
## 测试插件
-使用上游的配置,如果你的上流服务返回 500,连续 3 次。客户端将会收到 502(break_response_code)应答。
+使用上游的配置,在一定时间内如果你的上流服务返回 500 达到 3 次。客户端将会收到 502(break_response_code)应答。
```shell
$ curl -i "http://127.0.0.1:9080/hello"