Parallelism and Resource Groups: Improving Pipeline Performance and Resource Utilization
72%
Resource Groups
Speed and concurrency are important but they should not always be the main focus. In some cases, a balance between speed and resource utilization is necessary. There are some cases where we need to limit the number of concurrent jobs running in the pipeline. For example, when you host your GitLab instance on a server with limited resources or when you are deploying to a production environment and don't want to overload the target infrastructure with multiple deployments at the same time. In such cases, you can use resource groups.
Let's say we have this job:
stages:
- deploy
deploy:
stage: deploy
script:
- echo "Deploying to production"
By adding the keyword resource_group to the job to ensure that only one job is deploying to production at a time:
stages:
- deploy
deploy:
stageCloud Native CI/CD with GitLab
From Commit to Production ReadyEnroll now to unlock all content and receive all future updates for free.
