Hi, my gitea setup is getting slow, probably due to a couple of very big repositories which are receiving a lot of traffic and a build pipeline which submits a ton of requests to the Gitea API to retrieve information. I was wondering if I can horizontally scale my gitea setup and how should I do it, considering I am using docker images.
Can I just have multiple instances of the gitea container all referring to the very same shared disk and the same database? Should I just scale the system vertically?
Did you check the load on your DB? Are you using a “proper” DB Or still the built-in sqlite? It’s most likely related to it. Or to your session config being on “memory” and running out if resources.
You cannot just add more containers - this is not how docker works. Also it’s unlikely that the amount of API requests is causing any slowness. You’d need A LOT for this and then the question if you’re using a proxy in front or not.
As database I’m using a dedicated postgresql instance and I can double check the database container resources, actually I will double them, just to see if that changes anything.
Yes, I am using nginx as a reverse proxy, but that doesn’t do any funny trick, it’s just a simple proxy rule based on hostname.
I don’t think I have specified any config value for session, this should imply it is memory indeed, but for what I can see the container is not suffering of low memory… do you suggest to switch to database session management?
I disagree though with regards to horizontal scaling in docker: IMHO this is exactly how it is intended to work, when you need more horsepower, you instantiate more containers, all behind a load-balancing proxy.