Rate limits on Git operations
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Common Git operations, like clones, fetches, and pushes, can generate many requests in a short time. Rate limits on Git HTTP, Git LFS, and Git SSH operations protect the security and durability of your GitLab instance. Each of these limits works differently with the general user and IP rate limits. Each section explains how.
Git HTTP
If you use Git HTTP in your repository, common Git operations can generate many Git HTTP requests. GitLab can enforce rate limits on both authenticated and unauthenticated Git HTTP requests to improve the security and durability of your web application.
General user and IP rate limits aren’t applied to Git HTTP requests.
Git HTTP on GitLab.com
On GitLab.com, Git HTTP requests are subject to Git HTTPS request rate limits.
Configure unauthenticated Git HTTP rate limits
GitLab disables rate limits on unauthenticated Git HTTP requests by default.
Prerequisites:
- You must have administrator access.
To apply rate limits to Git HTTP requests that do not contain authentication parameters, enable and configure these limits:
- In the upper-right corner, select Admin.
- In the left sidebar, select Settings > Network.
- Expand Git HTTP rate limits.
- Select Enable unauthenticated Git HTTP request rate limit.
- Enter a value for Max unauthenticated Git HTTP requests per period per user.
- Enter a value for Unauthenticated Git HTTP rate limit period in seconds.
- Select Save changes.
Configure authenticated Git HTTP rate limits
GitLab disables rate limits on authenticated Git HTTP requests by default.
Prerequisites:
- You must have administrator access.
To apply rate limits to Git HTTP requests that contain authentication parameters, enable and configure these limits:
- In the upper-right corner, select Admin.
- In the left sidebar, select Settings > Network.
- Expand Git HTTP rate limits.
- Select Enable authenticated Git HTTP request rate limit.
- Enter a value for Max authenticated Git HTTP requests per period per user.
- Enter a value for Authenticated Git HTTP rate limit period in seconds.
- Select Save changes.
If required, you can allow specific users to bypass authenticated request rate limiting.
Git LFS
Git Large File Storage (LFS) is a Git extension for handling large files. Repositories that use Git LFS can generate a large number of LFS requests. You can enforce general user and IP rate limits, but you can also override the general setting to enforce additional limits on Git LFS requests. This override can improve the security and durability of your web application.
Git LFS on GitLab.com
On GitLab.com, Git LFS requests are subject to authenticated web request rate limits. These limits are set to 1000 requests per minute per user.
Each Git LFS object uploaded or downloaded generates an HTTP request that counts toward this limit.
Projects with multiple large files may encounter an HTTP rate limit error. This error occurs during cloning or pulling, when performed from a single IP address in automated environments like CI/CD pipelines.
Configure Git LFS rate limits
Git LFS rate limits are disabled by default on GitLab Self-Managed instances. Administrators can configure dedicated rate limits specifically for Git LFS traffic. When enabled, these dedicated LFS rate limits override the default user and IP rate limits.
Prerequisites:
- You must be an administrator for the instance.
To configure Git LFS rate limits:
- In the upper-right corner, select Admin.
- In the left sidebar, select Settings > Network.
- Expand Git LFS Rate Limits.
- Select Enable authenticated Git LFS request rate limit.
- Enter a value for Max authenticated Git LFS requests per period per user.
- Enter a value for Authenticated Git LFS rate limit period in seconds.
- Select Save changes.
Git SSH operations
GitLab applies rate limits to Git operations that use SSH by user account and project. When a user exceeds the rate limit, GitLab rejects further connection requests from that user for the project.
The rate limit applies at the Git command (plumbing) level. By default, each command has a rate limit of 600 per minute. For example:
git pushhas a rate limit of 600 per minute.git pullhas its own rate limit of 600 per minute.
The git-upload-pack, git pull, and git clone commands share a rate limit because they share commands.
General user and IP rate limits are not applied to Git SSH operations. SSH traffic reaches GitLab through the internal API, so it counts only against this limit.
Git SSH operations on GitLab.com
On GitLab.com, Git SSH operations use the default rate limit of 600 operations each minute. You cannot change this limit.
Configure the GitLab Shell operation limit
Git operations using SSH is enabled by default. Defaults to 600 per user per minute.
Prerequisites:
- Administrator access.
- In the upper-right corner, select Admin.
- In the left sidebar, select Settings > Network.
- Expand Git SSH operations rate limit.
- Enter a value for Maximum number of Git operations per minute.
- To disable the rate limit, set it to
0.
- To disable the rate limit, set it to
- Select Save changes.