Here are many examples to limit RPS for each client, at the same time, we also need a way to setup a global request limit.
There are two requirements for this purpose.
- instead track client ip, we need a global track.
- assume we want to setup 1k RPS as a global limit, it should alway allow first 1k requests and only cut off the excess parts.
Here is an example,