[Dnsmasq-discuss] excessive cpu consumption in 2.39rc1

Carlos Carvalho carlos at fisica.ufpr.br
Sun Apr 15 01:39:56 BST 2007


Simon Kelley (simon at thekelleys.org.uk) wrote on 14 April 2007 09:08:
 >Carlos Carvalho wrote:
 >> I really have a problem with this new code. The server is loaded and
 >> dnsmasq takes a long time to answer. I've got some angry users
 >> today...
 >
 >Dnsmasq tries to limit queue overflows by delaying  in the log() routine 
 >for longer and longer times as the queue length increases. That would 
 >explain the long query times, but it's rather strange that it's worse 
 >than with log-max=0, since the queue will only build up (thus causing 
 >delays) when syslogd is slow, and if syslogd is slow, then logging will 
 >block in the log-max=0 case, so that should be slow too.....

I don't know if it was worse, it looked as bad. I had to restore
service quickly, so I just turned logging off.

 >> I tried log-max=1000 to no avail. I had to disable logging to restore
 >> the service (make it fast enough).
 >
 >I recall that you do lots of logging: log-queries and log-dhcp? Is it 
 >faster with log-max=0?

No, that's why I had to turn off logging.

 >> It seems that log-max is limited to 25. This shouldn't happen...
 >> 
 >> Another alternative would be to disable the new code. In my case
 >> there's no risk of deadlock because the server that runs syslog (and
 >> dnsmasq) doesn't use dnsmasq itself, it's only for the clients.
 >> However setting log-max high enough should have the same effect.
 >> 
 >
 >log-max=0 does effectively disable the new behaviour, and I'm starting 
 >to thing that would be a better default, for precisely this sort of reason.

In summary, the new code seems to be working correctly. Thanks for it.

However I have two requests. First, the limiting of log-max to 25 is
against my principles. One must not change a user setting if the
implementation doesn't require it, and if it's done it must be
documented in BIG LETTERS.

Second, the increasing delays when there are queued log messages
should be documented and only happen above a certain fraction of
log-max queue usage. This is so that one can set a large log-max to
have fast response even with transient slow logging; that's what I
tried putting log-max=1000.



More information about the Dnsmasq-discuss mailing list