Welcome! Log In Create A New Profile

Advanced

Re: Nginx Rate limiting for HTTPS requests

May 22, 2018 12:37PM
>>- Make sure the $host variable you use for the limiting is not
>>empty and not changed between requests created by your testing
>>tool. Try logging the variable to see if it changes or not.
>>Alternatively, replace it with a static string to see if it helps.

Checked. $host variable is set for all the requests.

>>- Make sure there are no unrelated requests in the log. In
>>particular, you may want to use different logs in the server{}
>>block you are limiting and in the http{} block.

Checked. There are no unrelated requests in the log.

>>- Try another tool to see if you are able to reproduce the same
>>effect. Something simple like "ab" or "http_load" might be a
>>good choice.

Checked with "ab" with as following (concurrency 700 requests);
ab -n 20000 -c 700 https://9.0.0.10:443/test.html

Here is the piece of output. As per the report test ran for approx. 50 seconds and 20000-14622 = 5278 requests returned with success. This is as expected as per rate limiting at 100r/s for 50 seconds test. Notice that Mean requests processed per second is 396.

Concurrency Level: 700
Time taken for tests: 50.437 seconds
Complete requests: 20000
Failed requests: 14722
Requests per second: 396.53 [#/sec] (mean)

Access log report for this test as per the following command seems to be fine: grep ' 200 ' /path/to/log | awk '{print $4}' | uniq -c
111 [22/May/2018:15:35:04
101 [22/May/2018:15:35:05
95 [22/May/2018:15:35:06
98 [22/May/2018:15:35:07
97 [22/May/2018:15:35:08
106 [22/May/2018:15:35:09
95 [22/May/2018:15:35:10
99 [22/May/2018:15:35:11
104 [22/May/2018:15:35:12
106 [22/May/2018:15:35:13


In another test, I ran two instances of "ab" in parallel with same configuration and following is the output.This is again approx. 50 seconds test. By combining both the reports (20000+20000) - (9344+10239) = 20417 requests returned with success. This is four times of expected 5000 requests/sec rate. I would like to understand this behaviour. I guess this is happening in my tests as well. In my case I just keep pushing requests without waiting for response.

First instance:
Concurrency Level: 700
Time taken for tests: 46.944 seconds
Complete requests: 20000
Failed requests: 9344
Requests per second: 426.04 [#/sec] (mean)

Second Instance:
Concurrency Level: 700
Time taken for tests: 53.344 seconds
Complete requests: 20000
Failed requests: 10239
Requests per second: 374.92 [#/sec] (mean)


Access log report for this test as per the following command does not seem to be fine: grep ' 200 ' /path/to/log | awk '{print $4}' | uniq -c
180 [22/May/2018:15:52:59
276 [22/May/2018:15:53:00
33 [22/May/2018:15:53:01
20 [22/May/2018:15:53:00
70 [22/May/2018:15:53:01
1 [22/May/2018:15:53:00
181 [22/May/2018:15:53:01
16 [22/May/2018:15:53:02
2 [22/May/2018:15:53:01
99 [22/May/2018:15:53:02
1 [22/May/2018:15:53:01
177 [22/May/2018:15:53:02
329 [22/May/2018:15:53:03
8 [22/May/2018:15:53:02
Subject Author Posted

Nginx Rate limiting for HTTPS requests

rickGsp May 15, 2018 12:20PM

Re: Nginx Rate limiting for HTTPS requests

Maxim Dounin May 15, 2018 01:58PM

Re: Nginx Rate limiting for HTTPS requests

rickGsp May 16, 2018 05:00AM

Re: Nginx Rate limiting for HTTPS requests

Maxim Dounin May 16, 2018 09:28AM

Re: Nginx Rate limiting for HTTPS requests

rickGsp May 20, 2018 04:24AM

Re: Nginx Rate limiting for HTTPS requests

pbooth May 20, 2018 02:48PM

Re: Nginx Rate limiting for HTTPS requests

pbooth May 20, 2018 02:54PM

Re: Nginx Rate limiting for HTTPS requests

rickGsp May 21, 2018 01:09AM

Re: Nginx Rate limiting for HTTPS requests

Maxim Dounin May 21, 2018 08:14AM

Re: Nginx Rate limiting for HTTPS requests

rickGsp May 21, 2018 09:55AM

Re: Nginx Rate limiting for HTTPS requests

Maxim Dounin May 21, 2018 12:46PM

Re: Nginx Rate limiting for HTTPS requests

rickGsp May 22, 2018 12:37PM

Re: Nginx Rate limiting for HTTPS requests

Maxim Dounin May 22, 2018 02:02PM

Re: Nginx Rate limiting for HTTPS requests

rickGsp May 23, 2018 12:58AM

Re: Nginx Rate limiting for HTTPS requests

Maxim Dounin May 23, 2018 03:36PM

Re: Nginx Rate limiting for HTTPS requests

rickGsp May 25, 2018 01:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 220
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready