I'm frequently getting 503 Service Unavailable
when I have limit_req
turned on. On my logs:
[error] 22963#0: *70136 limiting requests, excess: 1.000 by zone "blitz", client: 64.xxx.xxx.xx, server: dat.com, request: "GET /id/85 HTTP/1.1", host: "dat.com"
My nginx configuration:
limit_req_zone $binary_remote_addr zone=blitz:60m rate=5r/s;
limit_req zone=blitz;
How do I resolve this issue. Isn't 60m already big enough? All my static files are hosted on a amazon s3.
Best Answer
503 Service unavailable
is returned whenever you hit the limit requests. From the limitreq documentation:You did not specify a burst rate, so whenevery you do more than 5 requests per second, you will get
HTTP 503 Service Unavailable
in return. Try raising your limit or specify a higher burst rate.