2020-05-24 23:13:21 +05:30
---
type: reference, concepts
2020-10-24 23:57:45 +05:30
stage: Enablement
group: Distribution
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-05-24 23:13:21 +05:30
---
2021-04-17 20:07:23 +05:30
# Reference architectures **(FREE SELF)**
2020-05-24 23:13:21 +05:30
You can set up GitLab on a single server or scale it up to serve many users.
2020-10-24 23:57:45 +05:30
This page details the recommended Reference Architectures that were built and
2021-02-22 17:27:13 +05:30
verified by the GitLab Quality and Support teams.
2020-05-24 23:13:21 +05:30
2020-10-24 23:57:45 +05:30
Below is a chart representing each architecture tier and the number of users
2021-04-29 21:17:54 +05:30
they can handle. As your number of users grow with time, it's recommended that
2020-10-24 23:57:45 +05:30
you scale GitLab accordingly.
2020-05-24 23:13:21 +05:30
![Reference Architectures ](img/reference-architectures.png )
<!-- Internal link: https://docs.google.com/spreadsheets/d/1obYP4fLKkVVDOljaI3 - ozhmCiPtEeMblbBKkf2OADKs/edit#gid=1403207183 -->
2021-02-22 17:27:13 +05:30
Testing on these reference architectures was performed with the
[GitLab Performance Tool ](https://gitlab.com/gitlab-org/quality/performance )
2020-10-24 23:57:45 +05:30
at specific coded workloads, and the throughputs used for testing were
calculated based on sample customer data. Select the
[reference architecture ](#available-reference-architectures ) that matches your scale.
2020-05-24 23:13:21 +05:30
2020-10-24 23:57:45 +05:30
Each endpoint type is tested with the following number of requests per second (RPS)
per 1,000 users:
2020-05-24 23:13:21 +05:30
- API: 20 RPS
- Web: 2 RPS
2021-03-11 19:13:27 +05:30
- Git (Pull): 2 RPS
- Git (Push): 0.4 RPS (rounded to nearest integer)
2020-05-24 23:13:21 +05:30
2020-10-24 23:57:45 +05:30
For GitLab instances with less than 2,000 users, it's recommended that you use
2020-11-24 15:15:51 +05:30
the [default setup ](#automated-backups ) by
2021-03-11 19:13:27 +05:30
[installing GitLab ](../../install/index.md ) on a single machine to minimize
2020-10-24 23:57:45 +05:30
maintenance and resource costs.
2020-05-24 23:13:21 +05:30
2021-02-22 17:27:13 +05:30
If your organization has more than 2,000 users, the recommendation is to scale the
GitLab components to multiple machine nodes. The machine nodes are grouped by
2020-10-24 23:57:45 +05:30
components. The addition of these nodes increases the performance and
scalability of to your GitLab instance.
2020-05-24 23:13:21 +05:30
When scaling GitLab, there are several factors to consider:
- Multiple application nodes to handle frontend traffic.
- A load balancer is added in front to distribute traffic across the application nodes.
- The application nodes connects to a shared file server and PostgreSQL and Redis services on the backend.
2021-02-22 17:27:13 +05:30
NOTE:
2020-10-24 23:57:45 +05:30
Depending on your workflow, the following recommended reference architectures
may need to be adapted accordingly. Your workload is influenced by factors
including how active your users are, how much automation you use, mirroring,
and repository/change size. Additionally the displayed memory values are
provided by [GCP machine types ](https://cloud.google.com/compute/docs/machine-types ).
For different cloud vendors, attempt to select options that best match the
provided architecture.
2020-05-24 23:13:21 +05:30
## Available reference architectures
The following reference architectures are available:
- [Up to 1,000 users ](1k_users.md )
- [Up to 2,000 users ](2k_users.md )
- [Up to 3,000 users ](3k_users.md )
- [Up to 5,000 users ](5k_users.md )
- [Up to 10,000 users ](10k_users.md )
- [Up to 25,000 users ](25k_users.md )
- [Up to 50,000 users ](50k_users.md )
2021-02-22 17:27:13 +05:30
A GitLab [Premium or Ultimate ](https://about.gitlab.com/pricing/#self-managed ) license is required
to get assistance from Support with troubleshooting the [2,000 users ](2k_users.md )
and higher reference architectures.
[Read more about our definition of scaled architectures ](https://about.gitlab.com/support/#definition-of-scaled-architecture ).
2020-05-24 23:13:21 +05:30
## Availability Components
2020-10-24 23:57:45 +05:30
GitLab comes with the following components for your use, listed from least to
most complex:
2020-05-24 23:13:21 +05:30
2020-11-24 15:15:51 +05:30
- [Automated backups ](#automated-backups )
- [Traffic load balancer ](#traffic-load-balancer )
- [Zero downtime updates ](#zero-downtime-updates )
- [Automated database failover ](#automated-database-failover )
- [Instance level replication with GitLab Geo ](#instance-level-replication-with-gitlab-geo )
2020-05-24 23:13:21 +05:30
As you implement these components, begin with a single server and then do
backups. Only after completing the first server should you proceed to the next.
Also, not implementing extra servers for GitLab doesn't necessarily mean that you'll have
more downtime. Depending on your needs and experience level, single servers can
have more actual perceived uptime for your users.
2021-04-17 20:07:23 +05:30
### Automated backups
2020-05-24 23:13:21 +05:30
> - Level of complexity: **Low**
> - Required domain knowledge: PostgreSQL, GitLab configurations, Git
This solution is appropriate for many teams that have the default GitLab installation.
With automatic backups of the GitLab repositories, configuration, and the database,
this can be an optimal solution if you don't have strict requirements.
[Automated backups ](../../raketasks/backup_restore.md#configuring-cron-to-make-daily-backups )
is the least complex to setup. This provides a point-in-time recovery of a predetermined schedule.
2021-03-11 19:13:27 +05:30
### Traffic load balancer **(PREMIUM SELF)**
2020-05-24 23:13:21 +05:30
> - Level of complexity: **Medium**
> - Required domain knowledge: HAProxy, shared storage, distributed systems
This requires separating out GitLab into multiple application nodes with an added
2021-01-03 14:25:43 +05:30
[load balancer ](../load_balancer.md ). The load balancer will distribute traffic
2020-05-24 23:13:21 +05:30
across GitLab application nodes. Meanwhile, each application node connects to a
shared file server and database systems on the back end. This way, if one of the
application servers fails, the workflow is not interrupted.
[HAProxy ](https://www.haproxy.org/ ) is recommended as the load balancer.
With this added component you have a number of advantages compared
to the default installation:
- Increase the number of users.
- Enable zero-downtime upgrades.
- Increase availability.
2021-03-08 18:12:59 +05:30
For more details on how to configure a traffic load balancer with GitLab, you can refer
to any of the [available reference architectures ](#available-reference-architectures ) with more than 1,000 users.
2021-03-11 19:13:27 +05:30
### Zero downtime updates **(PREMIUM SELF)**
2020-05-24 23:13:21 +05:30
> - Level of complexity: **Medium**
> - Required domain knowledge: PostgreSQL, HAProxy, shared storage, distributed systems
GitLab supports [zero-downtime updates ](https://docs.gitlab.com/omnibus/update/#zero-downtime-updates ).
2020-10-24 23:57:45 +05:30
Single GitLab nodes can be updated with only a [few minutes of downtime ](https://docs.gitlab.com/omnibus/update/README.html#single-node-deployment ).
To avoid this, we recommend to separate GitLab into several application nodes.
2020-05-24 23:13:21 +05:30
As long as at least one of each component is online and capable of handling the instance's usage load, your team's productivity will not be interrupted during the update.
2021-03-11 19:13:27 +05:30
### Automated database failover **(PREMIUM SELF)**
2020-05-24 23:13:21 +05:30
> - Level of complexity: **High**
2021-09-04 01:27:46 +05:30
> - Required domain knowledge: PgBouncer, Patroni, shared storage, distributed systems
2020-05-24 23:13:21 +05:30
By adding automatic failover for database systems, you can enable higher uptime
with additional database nodes. This extends the default database with
cluster management and failover policies.
2021-09-04 01:27:46 +05:30
[PgBouncer in conjunction with Patroni ](../postgresql/replication_and_failover.md )
2020-06-23 00:09:42 +05:30
is recommended.
2020-05-24 23:13:21 +05:30
2021-03-11 19:13:27 +05:30
### Instance level replication with GitLab Geo **(PREMIUM SELF)**
2020-05-24 23:13:21 +05:30
> - Level of complexity: **Very High**
> - Required domain knowledge: Storage replication
2020-11-24 15:15:51 +05:30
[GitLab Geo ](../geo/index.md ) allows you to replicate your GitLab
2020-05-24 23:13:21 +05:30
instance to other geographical locations as a read-only fully operational instance
that can also be promoted in case of disaster.
2021-02-22 17:27:13 +05:30
## Deviating from the suggested reference architectures
As a general rule of thumb, the further away you move from the Reference Architectures,
the harder it will be get support for it. With any deviation, you're introducing
a layer of complexity that will add challenges to finding out where potential
issues might lie.
The reference architectures use the official GitLab Linux packages (Omnibus
GitLab) to install and configure the various components (with one notable exception being the suggested select Cloud Native installation method described below). The components are
installed on separate machines (virtualized or bare metal), with machine hardware
requirements listed in the "Configuration" column and equivalent VM standard sizes listed
in GCP/AWS/Azure columns of each [available reference architecture ](#available-reference-architectures ).
Running components on Docker (including Compose) with the same specs should be fine, as Docker is well known in terms of support.
However, it is still an additional layer and may still add some support complexities, such as not being able to run `strace` easily in containers.
Other technologies, like [Docker swarm ](https://docs.docker.com/engine/swarm/ )
are not officially supported, but can be implemented at your own risk. In that
case, GitLab Support will not be able to help you.
### Configuring select components with Cloud Native Helm
2020-06-23 00:09:42 +05:30
We also provide [Helm charts ](https://docs.gitlab.com/charts/ ) as a Cloud Native installation
method for GitLab. For the reference architectures, select components can be set up in this
way as an alternative if so desired.
For these kind of setups we support using the charts in an [advanced configuration ](https://docs.gitlab.com/charts/#advanced-configuration )
where stateful backend components, such as the database or Gitaly, are run externally - either
via Omnibus or reputable third party services. Note that we don't currently support running the
stateful components via Helm _at large scales_ .
When designing these environments you should refer to the respective [Reference Architecture ](#available-reference-architectures )
above for guidance on sizing. Components run via Helm would be similarly scaled to their Omnibus
specs, only translated into Kubernetes resources.
For example, if you were to set up a 50k installation with the Rails nodes being run in Helm,
then the same amount of resources as given for Omnibus should be given to the Kubernetes
cluster with the Rails nodes broken down into a number of smaller Pods across that cluster.