mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user