diff options
-rw-r--r-- | etc/inc/unbound.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index 6ed6351..9fe32e4 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -95,16 +95,16 @@ function unbound_optimization() { if (is_array($config['sysctl']) && is_array($config['sysctl']['item'])) { foreach ($config['sysctl']['item'] as $tunable) { if ($tunable['tunable'] == 'kern.ipc.maxsockbuf') { - $so = floor(($tunable['value']/1024/1024)-1); + $so = floor(($tunable['value']/1024/1024)-4); // Check to ensure that the number is not a negative - if ($so > 0) { - // Limit to 8MB, users might set maxsockbuf very high for other reasons. + if ($so >= 4) { + // Limit to 32MB, users might set maxsockbuf very high for other reasons. // We do not want unbound to fail because of that. - $so = min($so, 8); + $so = min($so, 32); $optimization['so_rcvbuf'] = "so-rcvbuf: {$so}m"; - } - else + } else { unset($optimization['so_rcvbuf']); + } } } } @@ -682,4 +682,4 @@ function unbound_hosts_generate() { unbound_control("reload"); } -?> +?>
\ No newline at end of file |