Large bill because of self-hosted Github runners

5 months ago

I'm using the recommended template for hosting runners. I'm hosting two services, one with 8 replicas and the other with 2 replicas. 99% of the cost I incurred in last month's bill was because of RAM/memory build-up. It is substantially more expensive than Github's own action runners. I'm curious if I misconfigured something or if something is wrong.

https://hub.docker.com/r/myoung34/github-runner (recommended image used by the template)

Install docs followed: https://docs.railway.com/tutorials/github-actions-runners

$10 Bounty

1 Replies

shaezzy
PRO

6 days ago

I ran into a similar issue, I'm not sure why but even with one replica running the github runner consumes ~3GB of memory even not when running jobs. I switched to ephemeral runners which deregisters once complete, however since the containers would exit after one job, I would need to redeploy manually once all replicas were used and sitting inactive.

It was okay for my small solo project but got kind of annoying, so I created a lightweight service that automatically scales the runner when new jobs come in, and then scales back down once all jobs complete.

Scaling down I ran into some issues, as it terminates a random replica potentially cancelling an in-progress job. So I have it wait until all jobs are complete to set replicas back to 1. This works well for me, but if you have runners running most of the time, you might run into issues where replicas are only getting scaled up, and you have a bunch of inactive replicas sitting there.

Screenshot 2026-05-16 at 7.42.24 PM.png

I'm now seeing the memory scale down when runners are inactive. Here is the template if you want to try it out

Attachments


Welcome!

Sign in to your Railway account to join the conversation.

Loading...