GitLab allows you to manage your Git repositories, review code, track issues, and automate your software delivery with CI/CD pipelines. But running your own self-managed GitLab instance takes more than code. When there is little development activity, its application services, databases, background jobs, and other components consume memory.
So, what is the RAM requirement that GitLab needs?
The need depends on how big your team is, how often you use your repository, the amount of CI/CD jobs you have and the GitLab hosting server requirements you demand. A small personal install, works with a limited memory whilst a production install requires sufficient capacity to meet concurrent requests with absolute perfection.
GitLab RAM Requirements
RAM requirements differ if you’re choosing a VPS for scalability or using GitLab for everyday development.
- 2.5-4 GB RAM: Suitable for default configs. The GitLab documentation about constrained environments includes an event for up to five developers and small repos.
- 8 GB RAM: It is a good starting choice for a small business and a moderate workload.
- 16 GB RAM: This is the recommended RAM size for the current single node baseline of GitLab.
Why Does GitLab Require RAM?
- Application services: Handles web requests, repository browsing, merge requests, and project management.
- Postgres: Stores GitLab’s application data and executes database queries.
- Sidekiq: Handles background jobs like notifications and scheduled tasks.
- Redis: Supports caching, sessions, and background jobs.
How much RAM do I need for GitLab CI/CD?
CI/CD pipelines are memory hogging. More resources for build tools, automated tests, Docker containers, and concurrent jobs.
For example:
- Occasional Pipelines: Works with a standard GitLab install.
- Regular tracking: Needs close monitoring during peak activity
- Memory-intensive tests: They need more RAM for testing memory-intensive apps.
- Multiple jobs running together: Need resources to handle overlapping workloads
How to Choose the Right RAM?
The number of resources you need can vary from team to team if you merge in and push out code with some frequency.
- Repository activity: Overall workload is impacted by frequent changes, mirroring and size of repositories.
- Background jobs: Notifications, Scheduled tasks & automation may be costly.
- Other uses: If the server is running databases, monitoring tools or runners but you are using GitLab, then there is not as much RAM available to be used on GitLab.
- Future growth: Always select a plan that will grow with you as your plan grows.
Start with a documented baseline of the 16-GB system for a standard single node installation. Be aware of having too much work to do. Extra RAM / infrastructure may be required.
How to Decrease RAM Usage in GitLab?
If you aren’t able to upgrade right now, try these steps:
Refer to the checklist mentioned below for setup with limited memory:
- Dedicated CI/CD runners: Use dedicated machines for resource-heavy builds.
- Offload: If possible, run unrelated applications on different servers.
- Swap: Swap is useful when under memory pressure, but heavy usage tanks GitLab performance
- Monitor resource usage: Look at memory, CPU, and background job activity before deciding on upgrades.
Choosing the Right RAM
Consider factors that strike the balance between a VPS and dedicated server.
In general, the more often a team pushes code and opens merge requests, the more resources it will need compared to a team that uses GitLab only occasionally.
- Repository activity: The widget needs to be changed often, mirrored, and lots of repositories affect workload.
- Background jobs: Notifications and automation are resource intense, scheduled tasks.
- Other applications: If the Government’s GitLab is running on the same server that runs the monitoring tools, databases, runners, etc., less RAM will be available for the Government’s GitLab.
- Future growth: Choose a configuration to be augmented with additional load.
Use a documented minimum of 16GB for a normal single-node installation. If you have a lot of loads, watch your consumption, and think about extra RAM or extra infrastructure.
Conclusion
What RAM does Gitlab require? The amount of RAM required by Gitlab depends on the workload. A personal test was conducted using a small amount of memory. (Proper install) A small team starts with 8 GB. The smallest we have seen documented so far is 16 GB RAM in a standard single node deployment.
If you run other applications or frequently run CI/CD pipelines, consider isolating workloads or buying more capacity. See how it works in practice and then scale up the server when you need to.
