Overhead when enabling debug?

Maxim Dounin mdounin at mdounin.ru
Fri Sep 27 14:19:26 UTC 2013


Hello!

On Fri, Sep 27, 2013 at 09:16:39AM -0400, 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? 
> 
> i'd like to have it at hand for debugging certain issues every then and
> there.

While there is some overhead, it's actually nontrivial to show it.  
E.g. here are http_load results of a "return 204" test on my 
laptop (5 tests for each --with-debug and without debug, 10 
seconds each test), analyzed by ministat(1):

x bench.debug
+ bench.nodebug
+------------------------------------------------------------------------------+
|x                     xx   + +  +  +       x  x                              +|
|        |__________|___M___A____M_______A____|_______________|                |
+------------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5       7159.63       7754.85       7454.49      7503.202     240.43415
+   5       7503.91       8148.11       7566.35      7671.328     269.26662
No difference proven at 95.0% confidence


That is, tests done aren't enough to show the difference, if any.

Overall, I would recommend to don't bother and to compile --with-debug 
if there are chances you'll need it.

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx mailing list