About rate limits for GitHub Enterprise Server
Rate limits help prevent excessive resource use on your GitHub Enterprise Server instance that could affect availability or performance for all users. You can configure rate limits for the GitHub Enterprise Server APIs and GitHub Actions.
Implement rate limits carefully and communicate with your users as you tune them. Start with permissive rate limits and gradually adjust them to suit your environment.
You can also configure rate limits for authentication attempts to the Management Console. For more information, see Managing access to the Management Console.
Enabling rate limits for the GitHub Enterprise Server APIs
Too many requests to the GitHub Enterprise Server APIs can slow down your instance or make it unavailable. For more information about how API rate limits affect your users, see Rate limits for the REST API.
You can exempt specific users from API rate limits using the ghe-config utility in the administrative shell. For more information, see Command-line utilities.
Hinweis
The Management Console lists the time period (per minute or per hour) for each rate limit.
-
From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .
-
If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.
-
In the " Site admin" sidebar, click Management Console.
-
Under "Rate Limiting", select Enable HTTP API Rate Limiting.
-
Enter limits for authenticated and unauthenticated requests for each API, or accept the prefilled default limits.
-
Under the "Settings" sidebar, click Save settings.
Hinweis
Saving settings in the Management Console restarts system services, which could result in user-visible downtime.
-
Wait for the configuration run to complete.
Enabling secondary rate limits
Secondary rate limits help keep your GitHub Enterprise Server instance stable for all users.
-
From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .
-
If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.
-
In the " Site admin" sidebar, click Management Console.
-
Under "Rate Limiting", select Enable Secondary Rate Limiting.
-
Enter limits for Total Requests, CPU Limit, and CPU Limit for Searching, or accept the prefilled default limits.
-
Under the "Settings" sidebar, click Save settings.
Hinweis
Saving settings in the Management Console restarts system services, which could result in user-visible downtime.
-
Wait for the configuration run to complete.
Enabling rate limits for Git
If a member of GitHub's staff has recommended it, you can apply Git rate limits per repository network or per user ID. Git rate limits are measured in concurrent operations per minute and adapt to the current CPU load.
Warnung
Leave this setting disabled unless directly recommended by GitHub's staff. Git operations are rarely the leading driver of CPU and RAM usage. Enabling this feature can make Git operations more likely to fail under high load but doesn't address the underlying cause.
-
From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .
-
If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.
-
In the " Site admin" sidebar, click Management Console.
-
Under "Rate Limiting", select Enable Git Rate Limiting.
-
Under "Repository Network Limit", type a limit for each repository network.
-
Under "User ID Limit", type a limit for each user ID.
-
Under the "Settings" sidebar, click Save settings.
Hinweis
Saving settings in the Management Console restarts system services, which could result in user-visible downtime.
-
Wait for the configuration run to complete.
Configuring rate limits for GitHub Actions
You can apply a rate limit to GitHub Actions workflow runs. For more information about GitHub Actions, see About GitHub Actions for enterprises.
About rate limits for GitHub Actions
Your GitHub Enterprise Server instance assigns each GitHub Actions workflow job to a runner. If your instance can't immediately assign a job to an available runner, the job waits in a queue. If GitHub Actions experiences sustained high load, the queue can back up and the performance of your GitHub Enterprise Server instance may degrade.
To avoid this, you can configure a rate limit for GitHub Actions. This rate limit is measured in job runs per minute. GitHub Enterprise Server applies the rate limit across all job runs on the instance. If runs exceed the rate limit, additional runs fail instead of entering the queue. The following error appears in the run's annotations.
You've exceeded the rate limit for workflow run requests. Please wait before retrying the run.
A good rate limit protects your GitHub Enterprise Server instance from unusual spikes in GitHub Actions usage without interfering with day-to-day operations. The right threshold depends on your instance's available resources and typical workload. For more information about hardware requirements for GitHub Actions, see Getting started with GitHub Actions for GitHub Enterprise Server.
By default, the rate limit for GitHub Actions is disabled. GitHub Enterprise Server can handle temporary usage spikes without problems, so this rate limit protects against sustained high load. Leave it disabled unless you experience performance problems. In some cases, GitHub Support may recommend enabling a rate limit for GitHub Actions.
Enabling or disabling rate limits for GitHub Actions
-
SSH into your GitHub Enterprise Server instance. If your instance comprises multiple nodes, for example if high availability or geo-replication are configured, SSH into the primary node. If you use a cluster, you can SSH into any node. Replace HOSTNAME with the hostname for your instance, or the hostname or IP address of a node. For more information, see Accessing the administrative shell (SSH).
Shell ssh -p 122 admin@HOSTNAME
ssh -p 122 admin@HOSTNAME -
To enable and configure the rate limit, run the following two commands, replacing RUNS-PER-MINUTE with the value of your choice.
ghe-config actions-rate-limiting.enabled true ghe-config actions-rate-limiting.queue-runs-per-minute RUNS-PER-MINUTE -
To disable the rate limit, run the following command.
ghe-config actions-rate-limiting.enabled false -
To apply the configuration, run the following command.
ghe-config-apply -
Wait for the configuration run to complete.
Controlling the rate for the live update service
If the number of AJAX requests to your GitHub Enterprise Server instance causes problems, you may need to adjust the rate limit for the WebSockets controller used by these live updates. For details on how to view Alive requests, see About the monitor dashboard.
With primary rate limits enabled, the default limit is 100 requests per minute per IP address. Use the ghe-config utility in the administrative shell to set app.github.web-sockets-rate-limit to the number of requests allowed per minute per IP address, or to disable this rate limit. Setting the limit to any non-positive-integer value (for example, 0, -1, disabled) disables rate limiting on the WebSockets controller.
The app.github.web-sockets-rate-limit configuration setting was introduced in 3.15.8.
After you change these settings, run ghe-config-apply to apply them.