0

How to set/estimate proper value for nginx's "limit_req_zone" and "limit_req"? I have nginx as reverse-proxy for Django app. During loading for example admin panel (where Django request a lot of css/js files) I receiving more than ten 503's errors.

Current configuration:

limit_req_zone $binary_remote_addr zone=perip:5m rate=20r/s;
limit_req zone=perip burst=5 nodelay;

Is it a good practice, to set burst parameter for example to 20?
Is there maybe another way to handle it?

rah606
  • 1
  • 1
  • my question would be more why you getting 503. gets your server overloaded or bashed on request? do you use nginx as reverse proxy? If not it might a good thing to use a second instance one in front which you use to cache these request and offload thst from your "django" server – djdomi Sep 29 '19 at 15:28
  • @djdomi 503 is thrown due to blocking rule (more requests than is currently allowed - parameter rate=20r/s). – rah606 Sep 29 '19 at 16:34
  • why do you block it such low rate? evem my wiki has more as 31r/s for one Page – djdomi Sep 29 '19 at 16:38
  • @djdomi to prevent from DDos attacks. My server is rather low-end machine. – rah606 Sep 29 '19 at 18:41
  • then please add the specs of your server, ifi a ddos is incoming your server is mostly in any case the smallest member in the chain – djdomi Sep 29 '19 at 19:09
  • @djdomi micro instance on google-cloud – rah606 Oct 03 '19 at 20:05

0 Answers0