Changes between Version 8 and Version 9 of Ticket #1603, comment 6
- Timestamp:
- 08/06/18 02:55:46 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1603, comment 6
v8 v9 1 1 Leaky_bucket aside, this algorithm is classic。 2 2 If I just want to reject more than 1000 requests in a second。I have my doubts about your two downsides: 3 (1)2000 requests per millisecond, which also mutexes the count(ngx_shmtx_lock), so that if only 1,000 requests are allowed per second, the next 1,000 will be rejected。And the update request count is as follows:3 (1)2000 requests per millisecond, which also mutexes the req_count(ngx_shmtx_lock), so that if only 1,000 requests are allowed per second, the next 1,000 will be rejected。And the update request count is as follows: 4 4 If (now-last)/1000*limit_count is greater than req_count, then req_count=0; otherwise, req_count-(now-last)/1000*limit_count 。 Is that wrong? 5 5 (2)Is it because (now-last) time results may be too short,one millisecond of concurrency is too much and this one-second calculation may not work and result in server overload?