我有一个关于 istio 速率限制的问题

I have a question regarding istio rate limit

使用FIXED_WINDOW算法时,“validDuration”、“MaxAmount”参数是什么意思?

据我从 istio github repository about redis quota, there is no difference in validDuration and MaxAmount in rolling_window and fixed_window. The difference I found is there 中了解到,它与存储桶持续时间有关。

The bucketDuration will be ignored if rateLimitAlgorithm is FIXED_WINDOW

documentation

FIXED_WINDOW -> The fixed window approach can allow 2x peak specified rate, whereas the rolling-window doesn’t.

ROLLING_WINDOW -> The rolling window algorithm’s additional precision comes at the cost of increased redis resource usage.

看看关于max_amount and validDuration的redisquota代码。

所以我认为你的问题的答案是,引用旧 docs and above github repository code:

maxAmount -> int64 -> The upper limit for this quota.

validDuration -> Duration -> The amount of time allocated quota remains valid before it is automatically released. This is only meaningful for rate limit quotas, otherwise the value must be zero.

希望你觉得这很有用。