Open
Description
How does a Gitea deployment scale? Gitea cluster should resolve part of it.
Currently when running several Gitea instances which shared database, git storage. There is still something needs to resolve.
- Crons: Now every Gitea instance will run all the crons. It is duplicated work and will waste CPU and disk. The idea is the cron tasks should be spliced into all the Gitea instances.
- Migrating: You cannot stop the running migrating task. Because you don't know which Gitea instance is running it.
- Git Storage: A shared/copied git storage is required. If every Gitea instance will only store part of the repositories and when requests come, they will be routed to the right Gitea instance. Integrating Gitaly is a possible resolution.
comment by @wxiaoguang
- If there is no session-stick or ip-stick, I guess it would trigger database deadlock more frequently due to transaction conflicts.
- Actions Crons: And it conflicts with actions cron, there will be multiple tasks.
- Packages: And it would trigger docker's duplicate insert bug again because there is only a workaround (in process mutex) at the moment.
- UI notifications: I guess "event source" doesn't work with cluster either
- Locks: Some packages depend on the
ExclusivePool
pool, which is also in-process now.
Use global lock instead of NewExclusivePool to allow distributed lock between multiple Gitea instances #31813(based on Introduce globallock as distributed locks #31908)