Meziantou
Read post

Reduce GitHub Actions runner CPU usage

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.

    #devops#performance#linux#github-actions#bash
Dec 29, 2025•3m read time•From meziantou.net
Post cover image
Table of contents
# The problem: Busy-waiting# The solution: A smarter sleep script# A word of caution# Additional resources
884 Impressions
Meziantou's image
Meziantou

Meziantou's resource offers insights, tutorials, and resources for software developers and IT profes...

18 Followers

•

104 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard