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

1
  • 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
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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