This is an automated email from the ASF dual-hosted git repository.

nic-6443 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 e79d37789d docs(limit-count): correct when the delayed-sync snapshot 
is refreshed (#14017)
e79d37789d is described below

commit e79d37789de91dde23060e342265e7e189e0ba7f
Author: Nic <[email protected]>
AuthorDate: Tue Oct 13 14:52:50 2026 +0800

    docs(limit-count): correct when the delayed-sync snapshot is refreshed 
(#14017)
---
 docs/en/latest/plugins/limit-count.md | 2 +-
 docs/zh/latest/plugins/limit-count.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/en/latest/plugins/limit-count.md 
b/docs/en/latest/plugins/limit-count.md
index 0028e3b6ac..d4d8e7aa45 100644
--- a/docs/en/latest/plugins/limit-count.md
+++ b/docs/en/latest/plugins/limit-count.md
@@ -2195,6 +2195,6 @@ With delayed synchronization (`sync_interval`), the 
counter shared through Redis
 * `delayed_sync.synced_count`: the count of the current window in Redis at 
that time.
 * `delayed_sync.local_delta`: what this APISIX instance counted since then and 
has not synchronized yet, excluding this request.
 
-`current_window.count` is then an estimate, `synced_count + local_delta + 
cost`, that does not include what other instances counted since their last 
synchronization. For a sliding window, `current_window` and `previous_window` 
describe the windows at the time of the last synchronization: the weight 
applied to the previous window is fixed at synchronization time, so 
`previous_window.weight` is the weight that was used for this request, not the 
weight at `evaluated_at_ms`. The snapshot is  [...]
+`current_window.count` is then an estimate, `synced_count + local_delta + 
cost`, that does not include what other instances counted since their last 
synchronization. For a sliding window, `current_window` and `previous_window` 
describe the windows at the time of the last synchronization: the weight 
applied to the previous window is fixed at synchronization time, so 
`previous_window.weight` is the weight that was used for this request, not the 
weight at `evaluated_at_ms`. The snapshot is  [...]
 
 When multiple `rules` are configured, the variable describes the last rule 
that was checked, which is the rule that rejected the request if any did.
diff --git a/docs/zh/latest/plugins/limit-count.md 
b/docs/zh/latest/plugins/limit-count.md
index 71dc357163..6c7d46fddd 100644
--- a/docs/zh/latest/plugins/limit-count.md
+++ b/docs/zh/latest/plugins/limit-count.md
@@ -2196,6 +2196,6 @@ nginx_config:
 * `delayed_sync.synced_count`:当时 Redis 中当前窗口的计数。
 * `delayed_sync.local_delta`:该 APISIX 实例自那以后计入、尚未同步的值,不含本次请求。
 
-此时 `current_window.count` 是估算值,即 `synced_count + local_delta + 
cost`,不包含其他实例自各自上次同步以来的计数。对于滑动窗口,`current_window` 和 `previous_window` 
描述的是上一次同步时的窗口:上一个窗口的权重在同步时就已确定,因此 `previous_window.weight` 是本次请求实际使用的权重,而不是 
`evaluated_at_ms` 时刻的权重。快照只在其窗口结束之后才会刷新,因此在窗口边界之后几毫秒内到达的请求仍按上一次的快照判定,此时它的 
`evaluated_at_ms` 会晚于 `current_window.end_ms`。
+此时 `current_window.count` 是估算值,即 `synced_count + local_delta + 
cost`,不包含其他实例自各自上次同步以来的计数。对于滑动窗口,`current_window` 和 `previous_window` 
描述的是上一次同步时的窗口:上一个窗口的权重在同步时就已确定,因此 `previous_window.weight` 是本次请求实际使用的权重,而不是 
`evaluated_at_ms` 时刻的权重。快照在每次同步时都会被替换,同步会在请求之后 `sync_interval` 
内进行。此外,快照在窗口结束、到期时也会刷新。在窗口边界之后、下一次同步之前到达的请求仍按上一次的快照判定,因此它的 `evaluated_at_ms` 
可能短暂地晚于 `current_window.end_ms`。
 
 配置多条 `rules` 时,该变量描述最后一条被检查的规则;如果有规则拒绝了请求,就是该规则。

Reply via email to