File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use core_affinity:: CoreId ;
22use crossbeam_queue:: ArrayQueue ;
3+ use itertools:: Itertools ;
34use spacetimedb_paths:: server:: { ConfigToml , LogsDir } ;
45use std:: path:: PathBuf ;
56use std:: time:: Duration ;
@@ -194,7 +195,14 @@ pub struct Cores {
194195impl Cores {
195196 fn get ( ) -> Option < Self > {
196197 let cores = & mut core_affinity:: get_core_ids ( )
197- . filter ( |cores| cores. len ( ) >= 8 ) ?
198+ . filter ( |cores| cores. len ( ) >= 10 ) ?
199+ . into_iter ( )
200+ // We reserve the first two cores for the OS.
201+ // This allows us to pin interrupt handlers (IRQs) to these cores,
202+ // particularly those for incoming network traffic,
203+ // preventing them from preempting the main reducer threads.
204+ . filter ( |core_id| core_id. id > 1 )
205+ . collect_vec ( )
198206 . into_iter ( ) ;
199207
200208 let total = cores. len ( ) as f64 ;
You can’t perform that action at this time.
0 commit comments