Overhead when enabling debug?

Yichun Zhang (agentzh) agentzh at gmail.com
Fri Sep 27 19:31:46 UTC 2013


Hello!

On Fri, Sep 27, 2013 at 6:16 AM, mex wrote:
> i have a question regarding the --with-debug - option; do i have to expect
> much overhead,
> when compiling nginx with that option, but have it disabled per default?
>

We avoid enabling debug logs in production because when we really need
to debug online issues, debug logs are just too expensive to emit and
analyze (consider the box is currently experiencing an L7 attack).

Also, --with-debug compiles in extra code paths which *could* have
bugs and consume some extra CPU cycles even when you're not further
enabling it in nginx.conf.

Also, you'll never never have enough debug logs for answer those
really hard questions in production.

We only enable it for every day Nginx related development. For online
trouble shooting, we're relying on systemtap to do low overhead
dynamic tracing on various software stack levels, as demonstrated by
my Nginx Systemtap Toolkit:

    https://github.com/agentzh/nginx-systemtap-toolkit

and also all those samples in my stap++ project:

    https://github.com/agentzh/stapxx#samples

Hope these help.

Best regards,
-agentzh



More information about the nginx mailing list