Skip to content

Commit

Permalink
Merge pull request #87 from hezhijie0327/unbound
Browse files Browse the repository at this point in the history
Unbound
  • Loading branch information
hezhijie0327 committed May 2, 2024
2 parents 43edea5 + 97f84f6 commit 20aaba4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 6 additions & 6 deletions unbound/unbound.conf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ server:
infra-cache-max-rtt: 120000
infra-cache-min-rtt: 50
infra-cache-numhosts: 10000
infra-cache-slabs: 4
infra-cache-slabs: 1
infra-host-ttl: 900
infra-keep-probing: yes
insecure-lan-zones: no
Expand All @@ -100,12 +100,12 @@ server:
ip-ratelimit-backoff: yes
ip-ratelimit-factor: 10
ip-ratelimit-size: 4m
ip-ratelimit-slabs: 4
ip-ratelimit-slabs: 1
ip-transparent: yes
jostle-timeout: 200
keep-missing: 31622400
key-cache-size: 4m
key-cache-slabs: 4
key-cache-slabs: 1
## logfile: '/etc/unbound/work/unbound.log'
log-destaddr: no
log-identity: ''
Expand All @@ -129,7 +129,7 @@ server:
module-config: 'subnetcache validator cachedb iterator'
msg-buffer-size: 65552
msg-cache-size: 4m
msg-cache-slabs: 4
msg-cache-slabs: 1
nat64-prefix: 64:ff9b::/96
neg-cache-size: 1m
num-queries-per-thread: 1024
Expand All @@ -154,11 +154,11 @@ server:
ratelimit-backoff: yes
ratelimit-factor: 10
ratelimit-size: 4m
ratelimit-slabs: 4
ratelimit-slabs: 1
root-hints: '/etc/unbound/data/root.hints'
root-key-sentinel: yes
rrset-cache-size: 4m
rrset-cache-slabs: 4
rrset-cache-slabs: 1
rrset-roundrobin: yes
send-client-subnet: 0.0.0.0/0
send-client-subnet: ::/0
Expand Down
8 changes: 8 additions & 0 deletions unbound/unbound.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ CURL_OPTION=""
DOWNLOAD_CONFIG="" # false, true
USE_CDN="true"

NUM_THREADS="auto" # auto, 1

ENABLE_DNSSEC="false"
ENABLE_DNSSEC_PERMISSIVE_MODE="false"

Expand Down Expand Up @@ -127,6 +129,12 @@ function DownloadConfiguration() {
mkdir -p "${DOCKER_PATH}/work"
fi

if [ "${NUM_THREADS}" != "" ]; then
if [ "${NUM_THREADS}" == "auto" ]; then
NUM_THREADS=$(grep -c ^processor /proc/cpuinfo)
fi && sed -i "s/num-threads\: 1/num-threads\: ${NUM_THREADS:-1}/g" "${DOCKER_PATH}/conf/unbound.conf"
fi

if [ "${ENABLE_DNSSEC}" == "false" ]; then
sed -i "s/validator //g" "${DOCKER_PATH}/conf/unbound.conf"
fi
Expand Down

1 comment on commit 20aaba4

@hezhijie0327
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Forked Operation instead of threads. Due to some issues.

malloc(): unaligned tcache chunk detected
double free or corruption (fasttop)

Please sign in to comment.