Welcome! Log In Create A New Profile

Advanced

Re: --with-debug compile option

Ruslan Ermilov
June 27, 2012 03:46AM
On Wed, Jun 27, 2012 at 02:20:15PM +0800, agentzh wrote:
> Hello!
>
> On Wed, Jun 27, 2012 at 10:24 AM, paphillon <nginx-forum@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.

These aren't functions but are macros that first check if log_level is
set for debugging, and they don't pessimize performance in any measurable
way.

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

The same holds true for ngx_log_debugN() macros.

> Generally speaking, more code compiled (and run) means more
> bugs. I can catch issues in the debugging code from time to time.

Most of these allocate some register/stack space, do some assignments,
and empty loop at worst. Some of these can be optimized by first
checking if log_level was set for debugging (like is done in
ngx_select_process_events(), for example). Still, think they don't
pessimize performance measurable.

(There's some debugging code in SSL that's not conditional on the
log_level to be set for debugging.)

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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

--with-debug compile option

paphillon June 26, 2012 10:24PM

Re: --with-debug compile option

Ruslan Ermilov June 26, 2012 11:08PM

Re: --with-debug compile option

agentzh June 27, 2012 02:22AM

Re: --with-debug compile option

Ruslan Ermilov June 27, 2012 03:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 96
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready