chore(gateway): require 4 cores to spawn more TUN threads (#8775)

By default, we spawn 1 TUN send and 1 TUN receive thread on the Gateway.
In addition to that, we also have the main processing thread that
encrypts and decrypts packets. With #7590, we will be separating out the
UDP send and receive operations into yet another thread. As a result, we
will have at a minimum 4 threads running that perform IO or important
work.

Thus, in order to benefit from TUN multi-queue, we need more than 4
cores to be able to efficiently parallelise work.

Related: #8769
This commit is contained in:
Thomas Eizinger
2025-04-14 11:18:40 +10:00
committed by GitHub
parent 859aa3cee0
commit be897ed6c5

View File

@@ -261,7 +261,7 @@ struct NumThreads(pub usize);
impl Default for NumThreads {
fn default() -> Self {
if num_cpus::get() < 2 {
if num_cpus::get() < 4 {
return Self(1);
}