Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 have installed nginx and php-fpm on a 64-bit Ubuntu Server 11.10. The server works fine but I am trying to test the server (using ab) with 10,000 concurrent connections. When I try it I get socket: Too many open files (24).

I have tried some changes involving pam.d and the security conf but nothing worked. Any help would be greatly appreciated. Thanks

share|improve this question
Post your nginx config and try running nginx without php-fpm. – bodhi.zazen Jan 31 '12 at 17:22
up vote 1 down vote accepted

Found a solutions. I was looking at all wrong. nginx was not giving any errors. It was the Ubuntu client where I was running ab that was giving an error. The server was fine.

Solution (to be executed on the client i.e. the machine where you are running ab:

sudo su

this is to be root

ulimit -n 20000

this is to allow more than 10000 connections. I chose 20000 randomly.

Note that theses are not permanent settings and will be reset once you reboot.

Check out the below post for some more tweaks on the client side -

share|improve this answer

Your Answer


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.