From c051fc63378cc7942b6ca0cd0f97181e4d5cb661 Mon Sep 17 00:00:00 2001 From: bitwhisker Date: Tue, 26 May 2026 10:30:35 +0200 Subject: [PATCH] unbound(role): make unbound thread number configurable --- roles/unbound/README.md | 1 + roles/unbound/templates/unbound.conf.j2 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/unbound/README.md b/roles/unbound/README.md index 806b9d8..c44805b 100644 --- a/roles/unbound/README.md +++ b/roles/unbound/README.md @@ -17,3 +17,4 @@ The following variables can be used to customize this role: | unbound_enable_dnssec | Boolean | `true` | Whether dnssec validation should be enabled | | unbound_access_control | List of Strings | `[]` | **Required** List of [unbound access control values](https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#:~:text=access-control:%20%3CIP%20netblock%3E%20%3Caction%3E) | | unbound_disable_systemd_networkd | Boolean | `true` | If true, systemd-networkd is disabled and the local system is pointed towards the configured dns resolver. | +| unbound_thread_count | Integer | Max vCPU Count | The number of threads unbound uses | diff --git a/roles/unbound/templates/unbound.conf.j2 b/roles/unbound/templates/unbound.conf.j2 index 96aa9cd..d9b612c 100644 --- a/roles/unbound/templates/unbound.conf.j2 +++ b/roles/unbound/templates/unbound.conf.j2 @@ -7,8 +7,8 @@ server: auto-trust-anchor-file: "/etc/unbound/trusted-key.key" {% endif -%} - # use all CPUs - num-threads: {{ ansible_facts['processor_vcpus'] }} + # num of threads + num-threads: {{ unbound_thread_count | default(ansible_facts['processor_vcpus']) }} # more cache memory rrset-cache-size: 60m