0

I am running nginx version: nginx/1.10.2

I want to tune up my default configuration. According to https://www.nginx.com/blog/tuning-nginx/ I changed the somaxconn parameter in the OS and specified the same in nginx.conf

So my nginx.conf reads like

listen 80 backlog=16384;

But the moment I put backlog= in nginx.conf then nginx wont start with errors like

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

                                                       [FAILED]

And removing the backlog parameter nginx just works fine. How can I specify a higher backlog in nginx

Ram
  • 227
  • 1
  • 3
  • 5
  • `netstat -plnt` What is the result for this command? Do you see something on the port 80? But is it necessary for you to increase the backlog in the first place? Looks like just a hassle for me. – Bert Jul 24 '17 at 13:39

1 Answers1

0

This might happen because you alread have another vhosts with a listen statement. You have to either add the backlog to all listen statements or bind this one to a specific IP.

Christopher Perrin
  • 4,811
  • 19
  • 33