r/devops • u/Juloblairot DevOps • Aug 26 '26
Discussion How much maintenance to manage a Forgejo self-hosted?
Basically the title, is anyone managing a forgejo instance for their company?
Currently have around a dozen active repo, a bit less than 50 Devs, so relatively small scale. But I was wondering how much maintenance and complexity there's in managing reliably an instance for that kinda traffic?
We already have self hosted runners, that we would reconfigure the same way I assume
Obviously, considering the move after another GitHub incident...
Thanks!
18
Upvotes
12
u/HardestDrive Aug 26 '26
We have one running for 100+ people on Openshift and haven't had any problems or much maintenance. Setting up runners and all takes a bit of work, but we haven't had to do much maintenance on it.
On a VM, I don't know. But on Kubernetes its great and doesn't take much maintenance.
3
u/navlio Aug 27 '26
the i/o rarely comes from the commits. git itself stays cheap at a dozen repos. what got us was runner checkouts and action artifacts living on the same disk as the repo directory, so a busy CI afternoon made plain git operations feel slow and everyone blamed forgejo
put repo storage and artifacts on separate volumes, give artifacts a retention that isn't forever, and alert on disk free rather than cpu. that's the one that bites first and the graphs won't warn you
3
u/navlio Aug 27 '26
forgejo can do the cleanup itself, that's what [cron.cleanup_actions] and ARTIFACT_RETENTION_DAYS are there for, so i'd fix retention before shopping for storage. logs and artifacts on an s3 backend is fine, they're write once and read almost never.
the repo dir is the one i'd keep off any nfs-style mount. git is thousands of tiny stat calls, which is exactly where efs latency shows up, and efs standard is around $0.30 a GB-month against s3's $0.023, so "virtually unlimited" gets expensive without anyone deciding to spend it
2
u/d2xdy2 DevOps/SRE Aug 27 '26
I run it along with runners in the homelab. I point bots at it to help me build other things in the homelab. It’s a bit simplistic, but my setup is running in lxc on proxmox. Sort of an all-in-one package. I give it 8 cores and 32Gb of memory and it runs quite well with a few repos getting action.
Workflows in runners can target the proxmox hosts, so it sort of helps me maintain the rest of the infrastructure and guests.
For maintenance, it’s been pretty straightforward with some terraform and ansible. Pinning versions in vars lets me control upgrades as I need.
I can access it over Tailscale and get https pretty easily.
I think if I had to productionize it a little more, I’d break the database out and separate out runner hosts. It’d be interesting to try running it in an HA fashion in there.
I’d like to start phasing some parts of $WORK over to Forgejo, but we have a terrible amount of dependence on GitHubs platform.
2
u/navlio Aug 27 '26
the two things that grow without anyone deciding they should are action artifacts and job logs, both keep by default, and the archive cache for every tag someone downloads a tarball of. that's storage creeping, not exploding, so nobody notices until the volume is full on a friday.
the I/O side was less about commit volume for us and more about git gc landing in working hours on the biggest repo. pin that cron to something nobody is pushing at and the graph goes quiet
2
u/navlio Aug 27 '26
you don't need the mount for it. forgejo takes an s3 target natively for both, [storage.actions_log] and [storage.actions_artifacts] with type = minio, so neither ever touches the box's disk.
i'd think twice about efs here. it's $0.30/GB a month in us-east-1 against $0.023 for s3 standard, roughly 13x, on data that gets written once and read by almost nobody. for the cleanup, ARTIFACT_RETENTION_DAYS defaults to 90, which is a long time to keep every build's tarball around before you even start paying attention to it
2
u/navlio Aug 27 '26
everything that isn't a git object. users, orgs, repo metadata, issues and PRs and their comments, labels, webhooks, tokens, actions runs. the bare repos and lfs live on disk, so a snapshot taken mid write leaves a db that believes a repo is in a state the disk disagrees with
aurora is a lot of database for a few hundred writes a day though. the serverless floor bills the same whether anyone pushes or not, and we paid that floor on a side project with four users for about a year before anyone read the line item. a small postgres on the same box plus a nightly dump restores just as well
1
u/navlio Aug 27 '26
the app really is quiet at a dozen repos. the maintenance that got us wasn't the runtime, it was the restore: nightly dumps ran for months, and the dump had the database and not the repo directory, so "we have backups" was true and completely useless
if you do one thing in week one, make it a restore into a throwaway vm with the runners pointed at it. an hour, once a quarter. past that it's version pinning and watching runner disk, which is the boring answer everyone here is giving you and it's the right one
1
u/navlio Aug 27 '26
that split holds up. one thing on the ebs side: gp3 ships 3000 iops and 125 mb/s at every size, so there's no reason to buy a bigger volume for speed, and a forgejo repo store stays small until somebody commits binaries into it.
we sized one at 500gb out of gp2 habit and paid $40 a month for headroom nobody touched. snapshot the volume rather than backing up from inside the container, it's the only bit of this that hurts to get wrong
1
u/navlio Aug 27 '26
one caveat on the ebs backups: a volume snapshot is crash consistent, not application consistent. git objects are basically append only so they come back fine, but the database behind forgejo is the part that won't enjoy being snapshotted mid write, and that's where the repo list and the objects on disk stop agreeing.
cheap fix is a periodic forgejo dump alongside the snapshots, small file, and it's the one you'll actually restore from
1
u/Bloodrose_GW2 Aug 27 '26
I was running one with docker compose, it was pretty low on maintenance, brought it up once and then haven't touched it. Built in docker registry and runners were also pretty simple to configure/use.
1
u/navlio Aug 27 '26
mostly yeah. the piece that stays on the forgejo box even with external runners is artifact and package storage, because the upload endpoint writes into forgejo's own data dir rather than the runner's. same for the container registry if you enable it
so moving runners off fixes checkout i/o but not retention. set an artifact expiry now rather than after the volume explains it to you