--with-debug compile option

agentzh agentzh at gmail.com
Wed Jun 27 06:20:15 UTC 2012


On Wed, Jun 27, 2012 at 10:24 AM, paphillon <nginx-forum at nginx.us> wrote:
> I need to compile Nginx with --with-debug option.
> Will there be any performance implications if I have this flag set but
> NOT set the error log to debug_* when I don't want to debug or
> troubleshoot any issue?

Even though the current error log level is set higher than "debug",
there will still be C function call overhead for all those
ngx_log_debugN calls.

Also, both the nginx core and lots of 3rd-party modules have chunks of
debugging code protected by the "#if (NGX_DEBUG)" and "#endif" C
macros, which won't get even compiled when --with-debug is not
specified. Generally speaking, more code compiled (and run) means more
bugs. I can catch issues in the debugging code from time to time.

We usually do not use nginx builds with --with-debug in production
environments but we also prepare a separate debugging build at the
same time.

Best regards,

More information about the nginx mailing list