diff --git a/compute_tools/src/bin/compute_ctl.rs b/compute_tools/src/bin/compute_ctl.rs index 68f6bf3844..427ddf7206 100644 --- a/compute_tools/src/bin/compute_ctl.rs +++ b/compute_tools/src/bin/compute_ctl.rs @@ -222,11 +222,6 @@ fn main() -> Result<()> { compute.state_changed.notify_all(); drop(state); - // Launch remaining service threads - let _monitor_handle = launch_monitor(&compute).expect("cannot launch compute monitor thread"); - let _configurator_handle = - launch_configurator(&compute).expect("cannot launch configurator thread"); - // Start Postgres let mut delay_exit = false; let mut exit_code = None; @@ -243,6 +238,14 @@ fn main() -> Result<()> { } }; + // Launch remaining service threads + // + // NOTE we do this after starting postgres so that these two extra threads + // don't blow the cpu budget and throttle the startup process. + let _monitor_handle = launch_monitor(&compute).expect("cannot launch compute monitor thread"); + let _configurator_handle = + launch_configurator(&compute).expect("cannot launch configurator thread"); + // Wait for the child Postgres process forever. In this state Ctrl+C will // propagate to Postgres and it will be shut down as well. if let Some(mut pg) = pg {