[pve-devel] [PATCH] rbdplugin : disable debug_ms to increase performance

Alexandre DERUMIER aderumier at odiso.com
Wed Nov 9 17:05:54 CET 2016


>>Yes. But I do not understand why what influence performance? Or does it
>>trigger additional logging while everything runs normal?

Yes, I think it's always logging in memory when running normal. (the verbosity is from 0 to 20).


here the full explain:

from doc/dev/logs.rst


============
 Debug logs
============

The main debugging tool for Ceph is the dout and derr logging functions.
Collectively, these are referred to as "dout logging."

Dout has several log faculties, which can be set at various log
levels using the configuration management system. So it is possible to enable
debugging just for the messenger, by setting debug_ms to 10, for example.

Dout is implemented mainly in common/DoutStreambuf.cc

The dout macro avoids even generating log messages which are not going to be
used, by enclosing them in an "if" statement. What this means is that if you
have the debug level set at 0, and you run this code::

        dout(20) << "myfoo() = " << myfoo() << dendl;


myfoo() will not be called here.

Unfortunately, the performance of debug logging is relatively low. This is
because there is a single, process-wide mutex which every debug output
statement takes, and every debug output statement leads to a write() system
call or a call to syslog(). There is also a computational overhead to using C++
streams to consider. So you will need to be parsimonious in your logging to get
the best performance.

Sometimes, enabling logging can hide race conditions and other bugs by changing
the timing of events. Keep this in mind when debugging.


----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mercredi 9 Novembre 2016 16:00:04
Objet: Re: [pve-devel] [PATCH] rbdplugin : disable debug_ms to increase performance

> >>Seems the default is 0/5 - why? 
> 
> 0 is file logging 
> 5 is memory logging. 
> 
> The memory stats at display in output in case of assert or fatal signal. 

Yes. But I do not understand why what influence performance? Or does it 
trigger additional logging while everything runs normal? 




More information about the pve-devel mailing list