---
title: "Reduce GitHub Actions runner CPU usage"
url: https://daily.dev/posts/reduce-github-actions-runner-cpu-usage-sqgbskprc
source_url: https://www.meziantou.net/reduce-github-actions-runner-cpu-usage.htm
type: article
source: "Meziantou"
published: 2025-12-29T12:10:43.410Z
updated: 2025-12-29T12:11:03.500Z
tags: ["devops", "performance", "linux", "github-actions", "bash"]
reading_time: 3
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Reduce GitHub Actions runner CPU usage

**[Meziantou](https://daily.dev/sources/meziantou)** · 3 min read · 0 upvotes · 0 comments

## Summary

Self-hosted GitHub Actions runners consume excessive CPU due to a busy-waiting sleep implementation that continuously checks the system clock instead of using efficient OS-level sleep functions. This can be fixed by replacing the runner's safe_sleep.sh script with a smarter version that prioritizes native sleep commands, falls back to bash built-ins like read with timeout, and only uses busy-waiting as a last resort. The solution significantly reduces idle CPU usage, though changes may be overwritten during automatic runner updates.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.meziantou.net/reduce-github-actions-runner-cpu-usage.htm>

## Similar posts on daily.dev

- [1 vCPU Linux runner now generally available in GitHub Actions](https://daily.dev/posts/1-vcpu-linux-runner-now-generally-available-in-github-actions-2mmk9fdwb) · GitHub Changelog · 1 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#performance](https://daily.dev/tags/performance), [#linux](https://daily.dev/tags/linux), [#github-actions](https://daily.dev/tags/github-actions), [#bash](https://daily.dev/tags/bash)

[View this post on daily.dev](https://daily.dev/posts/reduce-github-actions-runner-cpu-usage-sqgbskprc)
