bundles/unbound: better caching
This commit is contained in:
parent
5935aed0db
commit
5e45efb7ae
2 changed files with 11 additions and 2 deletions
|
@ -27,7 +27,12 @@ server:
|
||||||
access-control: ::1 allow
|
access-control: ::1 allow
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
|
msg-cache-size: ${cache_size}
|
||||||
|
msg-cache-slabs: ${cache_slabs}
|
||||||
|
rrset-cache-size: ${cache_size}
|
||||||
|
rrset-cache-slabs: ${cache_slabs}
|
||||||
cache-max-ttl: ${max_ttl}
|
cache-max-ttl: ${max_ttl}
|
||||||
|
cache-max-negative-ttl: 600
|
||||||
|
|
||||||
use-syslog: yes
|
use-syslog: yes
|
||||||
log-queries: no
|
log-queries: no
|
||||||
|
|
|
@ -17,15 +17,19 @@ defaults = {
|
||||||
},
|
},
|
||||||
'unbound': {
|
'unbound': {
|
||||||
'max_ttl': 3600,
|
'max_ttl': 3600,
|
||||||
|
'cache_size': '512M',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor
|
@metadata_reactor
|
||||||
def cpu_cores_to_threads(metadata):
|
def cpu_cores_to_config_values(metadata):
|
||||||
|
num_cpus = metadata.get('vm/cpu', 1)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'unbound': {
|
'unbound': {
|
||||||
'threads': metadata.get('vm/cpu', 1)*2,
|
'threads': num_cpus*2,
|
||||||
|
'cache_slabs': 2**(num_cpus-1).bit_length(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue