Hello,
I have a few questions regarding the rate limiting module limit_req which does not act as I expect it to.
My configuration is the following:
I have an openresty load balancer which receives about 18K queries per second.
It is forwarding the requests to a single upstream which contains another openresty machine (with the exact same hardware), the latter just returning 200.
My concern is that even by setting up the limit_req module on the first machine, I am not seeing numbers that make sense to me when I query the nginx stats page on the backend machine.
Here are the relevant lines from the frontend configuration:
limit_req_zone $binary_remote_addr zone=perip:100m rate=1r/s;
limit_req zone=perip burst=1 nodelay;
--> Gives me around 1.8K QPS on the backend (10% requests from frontend hit the backend)
And
limit_req_zone $server_name zone=perip:100m rate=1r/s;
limit_req zone=perserver burst=1 nodelay;
--> Gives me around 18K QPS on the backend (100% requests from frontend hit the backend)
I am using a 16-cores machine but I still should be limiting the number of requests a lot more than what I am seeing, unless I'm misunderstanding something.
I would expect to see very few requests actually hit the backend, but that is not the case. Am I doing anything wrong? Do these numbers make sense with that configuration?