Bladeren bron

feat(www): remove general rate limit

tl;dr: We can cope with high load on static assets, and there seems
to be no scenario where an IP-based rate-limit would help. We should
be monitoring latency and bandwith.

I conducted tests in production from the same datacenter and concluded
that a rate limit is not needed for static content.

Tests (n: number of requests, c: concurrency):
- non-stress latency: ~20ms
- n=50000, c=100, 1.6KB file: 100% in 46s, 6 MB/s, latency ~90ms
- n=7500, c=100, 540KB file: 100% in 57s, 60-80 MB/s, latency ~750ms
- n=50000, c=1000, 1.6KB file: 99.9% in 46s, 6 MB/s, latency ~90ms

In the last case, there were 40 failures during SSL handshake. Rate
limiting happens after establishing the TLS connection, so it would
not have helped.
Peter Thomassen 5 jaren geleden
bovenliggende
commit
057e98e741
1 gewijzigde bestanden met toevoegingen van 0 en 3 verwijderingen
  1. 0 3
      www/conf/nginx.conf

+ 0 - 3
www/conf/nginx.conf

@@ -34,9 +34,6 @@ http {
     # if rate limits are exceeded, clients will receive a 503 answer (try again later)
     # rate limits are exceeded when the 'leaky bucket' is full
 
-    # set up one bucket per remote ip for general purpose
-    limit_req_zone $binary_remote_addr zone=perip-general:100m rate=30r/s;
-
     # set up one bucket per remote ip for (costly) API access
     limit_req_zone $binary_remote_addr zone=perip-api:100m rate=30r/s;