Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently updated to nginx 1.0.8 and tried to benchmark performance for cached dynamic pages (initially served by a Django app via proxy_pass) and for static pages. In both cases, nginx will not serve more than 3 or 4 requests (even without concurrent connections), so ab almost immediately reports:

apr_socket_recv: Connection reset by peer (54)

It is only when choosing a maximum of 4 (or fewer) requests that ab finishes successfully.

Why is that? I tried increasing the number of worker processes (no luck), but I assume that nginx should be capable of serving more than 4 requests without tweaking any configuration variable. Could it be that I accidentally triggered some sort of DOS protection mechanism?

share|improve this question
    
are you connecting to nginx locally or via a network? Is there anything in the nginx error log? – Shish Nov 18 '11 at 12:52
    
I connect locally, and the regular nginx error log is empty. Switching to log level 'info', it shows a couple of SIGIO und SIGCHLD signals, as well as exiting cache manager and worker processes exiting. – janeden Nov 18 '11 at 13:31

I was running the same issue with ab running locally testing against a simple Node.JS app. A workaround I found was using ab -r option that indicate Don't exit on socket receive errors.

But the underlying cause of this error is limited number of open sockets that you can have in you box. If you are using OSx you may refer to this answer to set higher numbers to this limits:

How to increase limits on sockets on osx for load testing

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.