2019-10-12 21:52:04 +05:30
---
2021-11-18 22:05:49 +05:30
stage: Manage
2022-04-04 11:22:00 +05:30
group: Authentication and Authorization
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2019-10-12 21:52:04 +05:30
type: reference, howto
---
2021-09-04 01:27:46 +05:30
# Rate limits **(FREE SELF)**
2019-10-12 21:52:04 +05:30
2021-02-22 17:27:13 +05:30
NOTE:
2023-04-23 21:23:45 +05:30
For GitLab.com, see
2019-10-12 21:52:04 +05:30
[GitLab.com-specific rate limits ](../user/gitlab_com/index.md#gitlabcom-specific-rate-limits ).
Rate limiting is a common technique used to improve the security and durability
of a web application.
2021-12-11 22:18:48 +05:30
For example, a simple script can make thousands of web requests per second. The requests could be:
- Malicious.
- Apathetic.
- Just a bug.
Your application and infrastructure may not be able to cope with the load. For more details, see
2019-10-12 21:52:04 +05:30
[Denial-of-service attack ](https://en.wikipedia.org/wiki/Denial-of-service_attack ).
Most cases can be mitigated by limiting the rate of requests from a single IP address.
Most [brute-force attacks ](https://en.wikipedia.org/wiki/Brute-force_attack ) are
similarly mitigated by a rate limit.
2021-12-11 22:18:48 +05:30
## Configurable limits
2019-10-12 21:52:04 +05:30
2021-12-11 22:18:48 +05:30
You can set these rate limits in the Admin Area of your instance:
2021-03-11 19:13:27 +05:30
- [Import/Export rate limits ](../user/admin_area/settings/import_export_rate_limits.md )
2022-07-23 23:45:48 +05:30
- [Issue rate limits ](../user/admin_area/settings/rate_limit_on_issues_creation.md )
- [Note rate limits ](../user/admin_area/settings/rate_limit_on_notes_creation.md )
2021-03-11 19:13:27 +05:30
- [Protected paths ](../user/admin_area/settings/protected_paths.md )
- [Raw endpoints rate limits ](../user/admin_area/settings/rate_limits_on_raw_endpoints.md )
- [User and IP rate limits ](../user/admin_area/settings/user_and_ip_rate_limits.md )
2021-06-08 01:23:25 +05:30
- [Package registry rate limits ](../user/admin_area/settings/package_registry_rate_limits.md )
2021-11-11 11:23:49 +05:30
- [Git LFS rate limits ](../user/admin_area/settings/git_lfs_rate_limits.md )
2021-11-18 22:05:49 +05:30
- [Files API rate limits ](../user/admin_area/settings/files_api_rate_limits.md )
- [Deprecated API rate limits ](../user/admin_area/settings/deprecated_api_rate_limits.md )
2022-04-04 11:22:00 +05:30
- [GitLab Pages rate limits ](../administration/pages/index.md#rate-limits )
2022-07-23 23:45:48 +05:30
- [Pipeline rate limits ](../user/admin_area/settings/rate_limit_on_pipelines_creation.md )
2022-08-13 15:12:31 +05:30
- [Incident management rate limits ](../user/admin_area/settings/incident_management_rate_limits.md )
2019-10-12 21:52:04 +05:30
2021-12-11 22:18:48 +05:30
You can set these rate limits using the Rails console:
- [Webhook rate limit ](../administration/instance_limits.md#webhook-rate-limit )
## Failed authentication ban for Git and container registry
GitLab returns HTTP status code `403` for 1 hour, if 30 failed authentication requests were received
in a 3-minute period from a single IP address. This applies only to combined:
- Git requests.
- Container registry (`/jwt/auth`) requests.
This limit:
- Is reset by requests that authenticate successfully. For example, 29 failed authentication
requests followed by 1 successful request, followed by 29 more failed authentication requests
would not trigger a ban.
- Does not apply to JWT requests authenticated by `gitlab-ci-token` .
- Is disabled by default.
No response headers are provided.
For configuration information, see
[Omnibus GitLab configuration options ](https://docs.gitlab.com/omnibus/settings/configuration.html#configure-a-failed-authentication-ban ).
2021-01-03 14:25:43 +05:30
## Non-configurable limits
2022-06-21 17:19:12 +05:30
### Git operations using SSH
2023-03-17 16:20:25 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/78373) in GitLab 14.7 [with a flag](../administration/feature_flags.md) named `rate_limit_gitlab_shell`. Available by default without a feature flag from 15.8.
2022-07-23 23:45:48 +05:30
GitLab applies rate limits to Git operations that use SSH by user account and project. When the rate limit is exceeded, GitLab rejects
further connection requests from that user for the project.
2022-06-21 17:19:12 +05:30
2022-07-16 23:28:13 +05:30
The rate limit applies at the Git command ([plumbing](https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain)) level.
2022-06-21 17:19:12 +05:30
Each command has a rate limit of 600 per minute. For example:
- `git push` has a rate limit of 600 per minute.
- `git pull` has its own rate limit of 600 per minute.
Because the same commands are shared by `git-upload-pack` , `git pull` , and `git clone` , they share a rate limit.
2022-07-23 23:45:48 +05:30
The requests per minute threshold for this rate limit is not configurable. Self-managed customers can disable this
rate limit.
2022-07-16 23:28:13 +05:30
2021-01-03 14:25:43 +05:30
### Repository archives
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25750) in GitLab 12.9.
2021-12-11 22:18:48 +05:30
A rate limit for [downloading repository archives ](../api/repositories.md#get-file-archive ) is
available. The limit applies to the project and to the user initiating the download either through
the UI or the API.
2021-01-03 14:25:43 +05:30
The **rate limit** is 5 requests per minute per user.
### Webhook Testing
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/commit/35bc85c3ca093fee58d60dacdc9ed1fd9a15adec) in GitLab 13.4.
2021-11-18 22:05:49 +05:30
There is a rate limit for [testing webhooks ](../user/project/integrations/webhooks.md#test-a-webhook ), which prevents abuse of the webhook functionality.
2021-01-03 14:25:43 +05:30
The **rate limit** is 5 requests per minute per user.
2022-03-02 08:16:31 +05:30
### Users sign up
2022-04-04 11:22:00 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339151) in GitLab 14.7.
2022-03-02 08:16:31 +05:30
There is a rate limit per IP address on the `/users/sign_up` endpoint. This is to mitigate attempts to misuse the endpoint. For example, to mass
2022-05-07 20:08:51 +05:30
discover usernames or email addresses in use.
2022-03-02 08:16:31 +05:30
The **rate limit** is 20 calls per minute per IP address.
### Update username
2022-04-04 11:22:00 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/339152) in GitLab 14.7.
2022-03-02 08:16:31 +05:30
2022-04-04 11:22:00 +05:30
There is a rate limit on how frequently a username can be changed. This is enforced to mitigate misuse of the feature. For example, to mass discover
2022-03-02 08:16:31 +05:30
which usernames are in use.
2023-03-17 16:20:25 +05:30
The **rate limit** is 10 calls per minute per authenticated user.
2022-03-02 08:16:31 +05:30
### Username exists
2022-04-04 11:22:00 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/29040) in GitLab 14.7.
2022-03-02 08:16:31 +05:30
2022-04-04 11:22:00 +05:30
There is a rate limit for the internal endpoint `/users/:username/exists` , used upon sign up to check if a chosen username has already been taken.
This is to mitigate the risk of misuses, such as mass discovery of usernames in use.
2022-03-02 08:16:31 +05:30
2022-05-07 20:08:51 +05:30
The **rate limit** is 20 calls per minute per IP address.
2022-03-02 08:16:31 +05:30
2023-03-04 22:38:38 +05:30
### Project Jobs API endpoint
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104912) in GitLab 15.7 [with a flag](../administration/feature_flags.md) named `ci_enforce_rate_limits_jobs_api`. Disabled by default.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available,
ask an administrator to [enable the feature flag ](../administration/feature_flags.md ) named `ci_enforce_rate_limits_jobs_api` .
The feature is not ready for production use.
There is a rate limit for the endpoint `project/:id/jobs` , which is enforced to reduce timeouts when retrieving jobs.
2023-03-17 16:20:25 +05:30
The **rate limit** is 600 calls per minute per authenticated user.
2023-03-04 22:38:38 +05:30
2023-06-20 00:43:36 +05:30
### AI action
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118010) in GitLab 16.0.
There is a rate limit for the GraphQL `aiAction` mutation, which is enforced to prevent from abusing this endpoint.
The **rate limit** is 20 calls per hour per authenticated user.
2021-12-11 22:18:48 +05:30
## Troubleshooting
### Rack Attack is denylisting the load balancer
Rack Attack may block your load balancer if all traffic appears to come from
the load balancer. In that case, you must:
1. [Configure `nginx[real_ip_trusted_addresses]` ](https://docs.gitlab.com/omnibus/settings/nginx.html#configuring-gitlab-trusted_proxies-and-the-nginx-real_ip-module).
This keeps users' IPs from being listed as the load balancer IPs.
1. Allowlist the load balancer's IP addresses.
1. Reconfigure GitLab:
```shell
sudo gitlab-ctl reconfigure
```
### Remove blocked IPs from Rack Attack with Redis
To remove a blocked IP:
1. Find the IPs that have been blocked in the production log:
```shell
grep "Rack_Attack" /var/log/gitlab/gitlab-rails/auth.log
```
1. Since the denylist is stored in Redis, you must open up `redis-cli` :
```shell
/opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket
```
1. You can remove the block using the following syntax, replacing `<ip>` with
the actual IP that is denylisted:
```plaintext
del cache:gitlab:rack::attack:allow2ban:ban:< ip >
```
1. Confirm that the key with the IP no longer shows up:
```plaintext
keys *rack::attack*
```
By default, the [`keys` command is disabled ](https://docs.gitlab.com/omnibus/settings/redis.html#renamed-commands ).
2019-10-12 21:52:04 +05:30
2021-12-11 22:18:48 +05:30
1. Optionally, add [the IP to the allowlist ](https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-rack-attack )
to prevent it being denylisted again.