Chenjp commented on PR #760: URL: https://github.com/apache/tomcat/pull/760#issuecomment-2408312003
Customize filter to skip remoteAddr obtain: ```java package filters; ... public class RateLimiterPerformanceFilter extends RateLimitFilter { .... private Random random = new Random(); @Override protected String parseQuotaIdentifier(ServletRequest request) { return "192.168.0."+(random.nextInt(20) + 1); } } ``` Sets policy: `q=1000;w=4` @isapir Runs tomcat standalone on my notebook, ab results as blow: ***no significant throughout decrease.*** ************************************************************* --Without rate limiter protection: ab -n 10000 -c 10 http://localhost:8080/examples/ratelimiter/None/bytecounter.html Document Path: /examples/ratelimiter/None/bytecounter.html Document Length: 1456 bytes Concurrency Level: 10 Time taken for tests: 6.338 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 17300000 bytes HTML transferred: 14560000 bytes Requests per second: 1577.86 [#/sec] (mean) Time per request: 6.338 [ms] (mean) Time per request: 0.634 [ms] (mean, across all concurrent requests) Transfer rate: 2665.72 [Kbytes/sec] received ************************************************************* Protected by FastRateLimiter ab -n 10000 -c 10 http://localhost:8080/examples/ratelimiter/Fast/bytecounter.html Document Path: /examples/ratelimiter/Fast/bytecounter.html Document Length: 1456 bytes Concurrency Level: 10 Time taken for tests: 6.393 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 17300000 bytes HTML transferred: 14560000 bytes Requests per second: 1564.21 [#/sec] (mean) Time per request: 6.393 [ms] (mean) Time per request: 0.639 [ms] (mean, across all concurrent requests) Transfer rate: 2642.66 [Kbytes/sec] received ************************************************************* Protected by ExactRateLimiter ab -n 10000 -c 10 http://localhost:8080/examples/ratelimiter/Exact/bytecounter.html Document Path: /examples/ratelimiter/Exact/bytecounter.html Document Length: 1456 bytes Concurrency Level: 10 Time taken for tests: 6.464 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 17300000 bytes HTML transferred: 14560000 bytes Requests per second: 1547.12 [#/sec] (mean) Time per request: 6.464 [ms] (mean) Time per request: 0.646 [ms] (mean, across all concurrent requests) Transfer rate: 2613.78 [Kbytes/sec] received -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org