problem: resource limit for git processes #12390
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Does your problem still exist on the latest Forgejo version?
Yes, the problem still exists (tested locally with the latest development version)
About your usage of Forgejo
Contributor of Forgejo
Member of the Forgejo security team.
Self-hosts Forgejo.
Co-Maintainer of Codeberg.org's Forgejo instance.
Problem description
This is issue was created as part of https://floss.social/@forgejo/116494296646568723.
Forgejo is a Git forge, and Forgejo interacts with Git via the
gitbinary1. This means that for a operation that involves git in some way, Forgejo executes thegitbinary. The implementation of git is surprisingly efficient, but still for some operations it simply has to do a lot of work in terms of CPU and memory.Forgejo puts no resource limit on the spawned git processes. This means that if you're asking git to do a expensive operation on large repositories, it can take all cpu cores and memory to do that work which generally results in. On Codeberg we see this quite often, most are due to crawler behavior of expensive endpoints but also genuine git clones, push, archives on large repositories. And when such git process is taking a lot of resources, it's a unfair share of the available resources and can make appear that Forgejo is slow as the system is technically under heavy load by this git process.
Potential workarounds
Forgejo Version
N/A
Other details about your environment (software names and versions)
N/A
Solutions
Accepted solutions to address this problem will go here
For context, go-git was supported at some point but was not faster and is lacking behind on newer features from git. CGO via libgit2 was never supported, and also lacks many features that we require. ↩︎