Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Many sites recommend using 'deferred' with the listen directive for nginx. Is this necessary on the Ubuntu installation or is "listen 80" sufficient with 'deferred' on by default?

listen 80 default deferred; # for Linux
share|improve this question
    
I would check the nginx wiki: wiki.nginx.org –  Thomas W. Jul 19 '11 at 20:12
    
The nginx wiki doesn't say what the default is. –  Adam Nelson Jul 25 '11 at 15:21
add comment

1 Answer

up vote 2 down vote accepted

deferred is not enabled by default on Ubuntu, there is no patch that enables it by default.

Below is my attempt to get an understanding of what the option does.

From the reference at http://wiki.nginx.org/HttpCoreModule#listen:

deferred -- indicates to use that postponed accept(2) on Linux with the aid of option TCP_DEFER_ACCEPT

Right, it refers to the manual page accept, section 2 - System calls (functions provided by the kernel). Unfortunately I couldn't find any information in that manual page about the effect of it, so I started digging in the source code (apt-get source nginx).

The option is enabled in nginx-0.8.54/src/http/ngx_http_core_module.c:3534. If deffered accept is not supported, you should get an error message on startup:

the deferred accept is not supported on this platform, ignored

At this point I stopped searching further. It wouldn't make sense if deferred is enabled by default in nginx if it cannot be disabled.

share|improve this answer
add comment

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.