Self-hosted runners are idle 70% of the time but queues spike at 10:00. What do you do?
AdvancedScenarioSpeed, Caching & Cost
Answer
Situation read → Static capacity sized for peak.
What I'd do →
- Move to ARC with
minRunnerssmall andmaxRunnerssized for peak, on a node pool managed by Karpenter with spot instances for CI. - Schedule higher
minRunnersduring working hours (a CronJob that patches the scale set, or two scale sets). - Pre-pull the runner image on nodes and keep images small to reduce cold starts.
- Measure queue time from the run timing API before and after.
Why → Autoscaling turns idle cost into burst cost, and spot cuts the burst cost further.
Interview tip → Mention handling spot interruptions: jobs are retried by re-running, so keep jobs idempotent.
More on Speed, Caching & Cost
`npm ci` takes 4 minutes on every run. Fix it.BeginnerDocker builds take 12 minutes even when only one line of code changed. Speed them up.IntermediateThe repo hits the 10 GB cache limit daily and hit rates are poor. What do you change?IntermediatemacOS jobs are 60% of your bill. What are your options?IntermediateA job sometimes hangs and burns 6 hours. How do you stop it happening again?BeginnerYour PR matrix is 3 OS times 4 versions (12 jobs). How do you cut cost without losing coverage?Advanced