GitLab CI/CD Minute Allocation and Resource Management

The operational backbone of GitLab.com's Continuous Integration and Continuous Deployment (CI/CD) infrastructure relies on a sophisticated metering system known as CI/CD minutes. This system serves as the primary mechanism for managing the shared compute resources provided by GitLab, ensuring that the platform remains sustainable and accessible for a global user base. At its core, CI/CD minutes are a measure of the compute time consumed by jobs executing on GitLab-hosted shared runners. Because shared runners are a finite resource maintained by GitLab, the company implements a tiered quota system to balance the needs of free users, paying customers, and specialized programs.

Understanding the nuances of these minutes is critical for developers and DevOps engineers to avoid pipeline failures due to quota exhaustion. The calculation of these minutes is not a simple 1:1 clock-time measurement but involves a cost factor that can vary based on the project's nature and the license tier. Furthermore, the distinction between GitLab SaaS (GitLab.com) and self-managed instances is fundamental, as the application of quotas differs entirely between the two environments. In the SaaS environment, quotas are a strict operational constraint, whereas in self-managed environments, they are an optional administrative tool used to govern internal resource consumption.

GitLab.com License Tier Quotas

The allocation of CI/CD minutes on GitLab.com is strictly tied to the subscription tier of the top-level group or the personal namespace. This tiered structure ensures that users who contribute more to the platform's financial sustainability receive higher limits of shared compute resources.

The current distribution of monthly CI/CD minutes across the standard tiers is as follows:

Tier Monthly Price CI/CD Minutes
Free $0 400
Bronze $4 2,000
Silver $19 10,000
Gold $99 50,000

The 400-minute limit for the Free tier was implemented effective October 1, 2020. This reduction was based on a data-driven analysis revealing that 98.5% of free users consumed 400 minutes or fewer per month. By aligning the limits with actual usage patterns, GitLab ensures the continued viability of the free tier while maintaining the operational efficiency of the company.

Specialized Program Allocations

GitLab recognizes the importance of the broader ecosystem and provides enhanced capabilities for specific demographics. Members of the GitLab for Open Source, GitLab for Education, and GitLab for Startups programs are exempt from the standard Free tier restrictions.

These specialized programs receive capabilities matching the Gold tier, which includes a monthly allocation of 50,000 CI/CD minutes per group. These limits remain unchanged to support the development of open-source software, academic research, and the rapid growth of new business ventures. Eligible users must apply through the respective program pages to gain access to these enhanced quotas.

CI/CD Minute Calculation Mechanics

The consumption of CI/CD minutes is not a linear measurement of the time a pipeline takes to complete. Instead, it is calculated using a specific mathematical formula to account for the actual resource load on the shared runners.

The formula used by GitLab is:
Job duration * Cost factor

The job duration is defined as the time, measured in seconds, that a job took to run on a shared runner. It is important to note that time spent in the created or pending statuses is excluded from this calculation. Only the active execution time counts toward the quota.

Furthermore, the total CI/CD minute usage for a pipeline can exceed the end-to-end duration of that pipeline. This occurs because jobs can run concurrently. If three jobs each run for 10 minutes simultaneously, the end-to-end duration of the pipeline is 10 minutes, but the total CI/CD minute consumption is 30 minutes.

The Cost Factor and Reduced Rates

For most users, the cost factor is standard. However, GitLab provides a reduced cost factor for projects that contribute directly to the GitLab product itself. This incentive is designed to encourage contributions to GitLab-maintained projects, such as gitlab-com/www-gitlab-com or gitlab-org/gitlab.

The maximum potential for these contributors is 300,000 minutes, though this is subject to the availability of shared runners. The total available minutes are reduced by the usage of other projects on the platform.

The cost factor for these projects is calculated as:
Monthly minute quota / 300,000 job duration minutes = Cost factor

For a user on the Premium tier with 10,000 monthly minutes, the calculation would be:
10,000 / 300,000 = 0.03333333333 cost factor

This significantly reduces the amount of the quota consumed for every second of job execution, provided the merge request source project is a fork of a GitLab-maintained project.

Purchasing Additional CI/CD Minutes

When the monthly quota is insufficient, users on GitLab SaaS have the option to purchase additional minute packs. These packs are priced at $10 per 1,000 minutes.

The behavior of purchased minutes differs from the monthly subscription quota:

  • Purchased minutes are only utilized after the monthly subscription quota has been fully exhausted.
  • Any remaining purchased minutes at the end of the month carry over to the next month.
  • Purchased minutes remain valid for 12 months from the date of purchase or until they are fully consumed.
  • While there is an expiry window, the expiry of minutes is not strictly enforced.

For example, a Premium user with 10,000 monthly minutes who purchases an additional 5,000 minutes has a total limit of 15,000. If they use 13,000 minutes, 2,000 purchased minutes carry over. If they use 9,000, the full 5,000 purchased minutes remain.

Minutes purchased during a trial subscription remain available after the trial ends or after the user upgrades to a paid plan.

Purchasing Process for Personal Namespaces and Groups

The process for adding minutes depends on whether the namespace is a personal account or a group.

To purchase minutes for a personal namespace on Free SaaS:

  1. Select the avatar in the upper-right corner of the top bar.
  2. Select Edit profile.
  3. Select Usage Quotas from the left sidebar.
  4. Select Buy additional minutes.
  5. Complete the transaction via the Customers Portal.

To purchase minutes for a group on Free SaaS:

  1. Navigate to the top bar and select Main menu > Groups.
  2. Locate and select the specific group.
  3. Select Settings > Usage Quotas from the left sidebar.
  4. Select Pipelines.
  5. Select Buy additional minutes.
  6. Complete the transaction details.

It is critical to ensure the correct group is selected during this process, as purchased CI/CD minutes cannot be transferred from one group to another.

Managing Quotas on Self-Managed Instances

The logic for CI/CD minutes on self-managed GitLab instances differs fundamentally from the SaaS version. By default, quotas are disabled, meaning the default value is 0, which grants unlimited CI/CD minutes. When quotas are enabled, they apply only to private projects.

Global Quota Configuration

GitLab administrators can set a default quota that applies to all namespaces. This functionality was moved to GitLab Premium in version 13.9.

To change the default global quota:

  1. Select Main menu > Admin on the top bar.
  2. Select Settings > CI/CD from the left sidebar.
  3. Expand the Continuous Integration and Deployment section.
  4. Enter the maximum number of CI/CD minutes in the Quota of CI/CD minutes box.
  5. Select Save changes.

Note that if a specific namespace already has a defined quota, changing the global default will not override that existing namespace-specific quota.

Namespace-Specific Quota Overrides

Administrators can override the global value for specific top-level groups or user namespaces. This allows for granular control over resource distribution within an organization.

To set a quota for a specific namespace:

  1. Select Main menu > Admin on the top bar.
  2. Select Overview > Groups from the left sidebar.
  3. Select Edit for the target group.
  4. Enter the maximum number of CI/CD minutes in the Quota of CI/CD minutes box.
  5. Select Save changes.

Strategies for Reducing CI/CD Minute Consumption

To avoid the costs of purchasing additional minutes or the limitations of the Free tier, users can implement several optimization strategies.

The most effective method for eliminating shared runner costs is to bring your own runners. GitLab only counts minutes when the shared runners provided by GitLab.com are utilized. By hosting a private runner on local hardware or a cloud instance, users can execute an unlimited number of jobs without impacting their CI/CD minute quota. Users can run specific runners for any of their projects to regain full control over their compute resources.

Conclusion

The GitLab CI/CD minute system is a balancing act between providing a robust free service and maintaining the operational sustainability of the shared infrastructure. The transition to a 400-minute limit for free users reflects a strategic alignment with actual usage data, ensuring that the vast majority of users remain unaffected while the platform optimizes its costs. The complexity of the system—ranging from the cost factor calculations for open-source contributors to the administrative overrides in self-managed instances—demonstrates a flexible approach to resource management.

For the end-user, the primary takeaway is the distinction between shared and private runners. While the tiered quota system (Free, Bronze, Silver, Gold) provides a clear path for scaling, the ability to integrate external runners remains the ultimate solution for those with high-compute requirements. The integration of carry-over logic for purchased minutes and the specialized support for Education and Startup programs further indicate GitLab's intent to support a diverse ecosystem of developers, regardless of their financial capacity. Ultimately, the efficiency of a CI/CD pipeline is not just measured by the speed of the code deployment, but by the optimization of the resources used to achieve that deployment.

Sources

  1. GitLab Blog - CI/CD Minutes Update
  2. Genboree GitLab Help - CI/CD Minutes

Related Posts