]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/system/unbound
unbound: Double buffer size
[ipfire-2.x.git] / src / initscripts / system / unbound
index bbf9c002e606a8c79acb551fd24c9a5dfe26f2bc..d11ca82a4ffb0b6ad533135444d850d2c865a891 100644 (file)
@@ -246,15 +246,15 @@ write_tuning_conf() {
 
        # Large systems with more than 2GB of RAM
        if [ ${mem} -ge 2048 ]; then
-               mem=128
+               mem=256
 
        # Small systems with less than 256MB of RAM
        elif [ ${mem} -le 256 ]; then
-               mem=8
+               mem=16
 
        # Everything else
        else
-               mem=32
+               mem=64
        fi
 
        (
@@ -262,6 +262,7 @@ write_tuning_conf() {
 
                # We run one thread per processor
                echo "num-threads: ${processors}"
+               echo "so-reuseport: yes"
 
                # Adjust number of slabs
                echo "infra-cache-slabs: ${slabs}"
@@ -273,6 +274,14 @@ write_tuning_conf() {
                echo "rrset-cache-size: $(( ${mem} / 2 ))m"
                echo "msg-cache-size: $(( ${mem} / 4 ))m"
                echo "key-cache-size: $(( ${mem} / 4 ))m"
+
+               # Increase parallel queries
+               echo "outgoing-range: 8192"
+               echo "num-queries-per-thread: 4096"
+
+               # Use larger send/receive buffers
+               echo "so-sndbuf: 4m"
+               echo "so-rcvbuf: 4m"
        ) > /etc/unbound/tuning.conf
 }