Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
19 lines
840 B
Plaintext
19 lines
840 B
Plaintext
== free-key-123 allows 5 per minute; requests alternate between instance A and B
|
|
sent to A -> 200 remaining=4 (served by A)
|
|
sent to B -> 200 remaining=3 (served by B)
|
|
sent to A -> 200 remaining=2 (served by A)
|
|
sent to B -> 200 remaining=1 (served by B)
|
|
sent to A -> 200 remaining=0 (served by A)
|
|
sent to B -> 429 remaining=0 (served by -)
|
|
sent to A -> 429 remaining=0 (served by -)
|
|
allowed in total: 5 (not 10)
|
|
== one bucket in Redis, written by both instances
|
|
$ redis-cli --scan
|
|
rl:global
|
|
rl:key:c31ab6f47fba3609
|
|
== 200 concurrent requests for pro-key-456 (20 per minute), half to A and half to B
|
|
200 sent: 20 allowed, 180 rejected with 429
|
|
== instance B's clock is 30 s ahead of A's (user carol: 10 per minute, one token per 6 s)
|
|
A, bucket empty -> 429
|
|
B sees 30 s of refill that never happened on A's clock: 5 of 8 allowed
|