Enhancement #3024

Adjust default dnsmasq cache

Added by Filippo Carletti over 6 years ago. Updated about 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-dnsmasq
Target version:v6.6
Resolution: NEEDINFO:No

Description

dnsmasq has a default cache of 150 entries, which is way too low for common usage.
See:

Feb  4 16:33:38 nethsecurity dnsmasq[4394]: cache size 150, 72090/212896 cache insertions re-used unexpired cache entries.

72090 entries were pushed out of unexpired, wasting bandwidth and slowing name resolution.

Associated revisions

Revision b3a55f50
Added by Giacomo Sanchietti about 6 years ago

dnsmasq.conf: add CacheSize option. Refs #3024

History

#1 Updated by Filippo Carletti over 6 years ago

I'd like to increase cache size to 4096.
I've done some tests, see:

Feb  5 15:52:50 nethsecurity dnsmasq[4538]: cache size 4096, 0/236956 cache insertions re-used unexpired cache entries.

Command to check dnsmasq stats:

killall -USR1 dnsmasq

#2 Updated by Giacomo Sanchietti over 6 years ago

  • Category set to nethserver-dnsmasq

I'd like to to have a simple prop inside the database but hidden from the web interface. What do you think?

#3 Updated by Filippo Carletti over 6 years ago

Ok, only a prop in the db, but I'd like to have 4096 (or 2048) as default, not dnsmasq default.

#4 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from NEW to TRIAGED
  • Target version changed from v6.6-rc1 to v6.6
  • % Done changed from 0 to 20

#5 Updated by Filippo Carletti over 6 years ago

Every host in cache needs roughly 100 bytes, so I think that 4000 is a good default.
Also, the maximum size of the cache is 10000, so the template needs to limit the value.

#6 Updated by Filippo Carletti about 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#7 Updated by Giacomo Sanchietti about 6 years ago

  • Assignee set to Giacomo Sanchietti

#8 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

#9 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-dnsmasq-1.4.3-1.2.gb3a55f5.ns6.noarch.rpm
Test case 1
  • Install the package
  • Send SIGUSR1 to dnsmaq:
    pkill -SIGUSR1 dnsmasq
    
  • Search in /var/log/messages for a line like this:
    May 14 11:45:10 localhost dnsmasq[24132]: cache size 4000, 0/0 cache insertions re-used unexpired cache entries.
    
Test case 2
  • Change the cache size value
    config setprop dnsmasq CacheSize 100
    signal-event nethserver-dnsmasq-save
    
  • Send the SIGUSR1 signal and check the cache size is 100
Test case 3
  • Change the cache size to a value greater than 10000 (maximum allowed value)
    config setprop dnsmasq CacheSize 20000
    signal-event nethserver-dnsmasq-save
    
  • Send the SIGUSR1 signal and check the cache size is capped to 10000

#10 Updated by Filippo Carletti about 6 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

Note: pkill won't work if you have libvirt installed.
Pre-upgrade:
May 15 19:02:20 ns65 dnsmasq2607: cache size 150, 0/0 cache insertions re-used unexpired cache entries.
Case 1:
May 15 19:04:48 ns65 dnsmasq15937: cache size 4000, 0/0 cache insertions re-used unexpired cache entries.
Case 2:
May 15 19:06:34 ns65 dnsmasq16016: cache size 100, 0/0 cache insertions re-used unexpired cache entries.
Case 3:
[root@ns65 ~]# config show dnsmasq
dnsmasq=service
CacheSize=30000
May 15 19:07:36 ns65 dnsmasq16123: cache size 10000, 0/0 cache insertions re-used unexpired cache entries.

#11 Updated by Giacomo Sanchietti about 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-updates:
  • nethserver-dnsmasq-1.4.4-1.ns6.noarch.rpm

Also available in: Atom PDF