There is an nginx server with 2 worker_threads and 500 worker_connections.
I use Apache HTTP benchmarking tool (ab) to create >1500 clients that constantly requests cached data from nginx. In parallel I execute some wget-s and browser sessions with the same request.
After some time nginx starts to refuse connections with clients receiving "connection reset by peer".
Question: is there a way to make nginx return correct "503 Unavailable" errors on high load instead of refusing connections?