Nginx Rate limiting for HTTPS requests
mdounin at mdounin.ru
Wed May 16 13:27:14 UTC 2018
On Wed, May 16, 2018 at 05:00:20AM -0400, rickGsp wrote:
> Thanks for responding Maxim. I understood what you are pointing at. Yes I
> have taken care of time measurement. Actually my test runs for 60 seconds
> and in total I expect 6000 requests returning 200 status with rate limit
> configured at 100r/s. However I see 9000 requests returning 200 status which
> means 150 req/sec.
As I tried to explain in my previous message, "test runs for 60
seconds" can have two different meanings: 1) the load is generated
for 60 seconds and 2) from first request started to the last
request finished it takes 60 seconds.
Make sure you are using the correct meaning. Also, it might
be a good idea to look into nginx access logs to verify both time
and numbers reported by your tool.
> Shall I expect that even for HTTPS, rate limiting should work as perfectly
> as plain HTTP case. If yes, I am just wondering if there is something I am
> missing while configuring Nginx rate limiting for HTTPS.
Yes, request rate limiting is expected to work identically for
both HTTP and HTTPS. The difference of HTTPS is that it, in
contrast to HTTP, requires a lot of resources for SSL handshakes,
and it is perfectly normal if your server cannot handle 500
handshakes per second at all. As such, total test time might be
significantly different from load generation time.
More information about the nginx