Goal
Find the user, service account, and API key behind excessive Octopus REST API traffic, so you can slow it down before it degrades the Octopus Web Portal or causes HTTP 429 Too Many Requests responses. This applies to Octopus Cloud and self-hosted Octopus Server. Rate limit audit events need Octopus 2026.3 or newer, and web request logging is available on self-hosted Octopus Server only.
Prerequisites
- The ConfigureServer system permission to change rate limiting policies. The built-in System Administrator and System Manager roles both include it. On self-hosted Octopus Server, members of the Octopus Administrators team have it by default. On Octopus Cloud, use the Octopus Managers team, because the Octopus Administrators team is reserved for Octopus support/system tasks.
- The EventView permission to read the audit log.
- Octopus administrator access to see every API key on the API Keys page.
- Octopus 2026.3 or newer for rate limit audit events. Older versions can only use web request logging.
- For web request logging: access to each Octopus Server host, and permission to restart the Octopus Server service.
Steps
The audit log records which API key made each create, edit, or delete request, but it doesn't record read requests. Rate limit audit events and web request logs record the user or service account, not the key. Excessive traffic is often read requests, such as a script polling a task's status, so you usually find the account first, then the key.
Octopus Cloud and Self-Hosted Octopus Server 2026.3 or Newer
-
Turn on audit mode for rate limiting. In the Octopus Web Portal, go to Configuration ➜ Settings ➜ Rate Limiting. Open the Authenticated Requests policy, select Enabled and Audit mode, and save. Do the same for Unauthenticated Requests if you suspect traffic that isn't signed in. Audit mode records which clients would have been limited, without rejecting any requests. If your policies are already enforced, skip this step.
-
Find the account in the audit log. Wait for the excess traffic to happen again, then go to Configuration ➜ Audit. Look for events like
Rate limit policy Authenticated requests exceeded for <user> from <IP address>, and note the user or service account and the IP address. In a high availability cluster, each node counts requests separately, so a client can send up to the limit multiplied by the number of nodes before an event appears. -
Find the API key. If the traffic includes create, edit, or delete requests, the audit log names the key: go to Configuration ➜ Audit, select Show advanced filters, and filter by API keys. The audit log shows a masked version of each key, which you can match to a key on the API Keys page. For read requests, go to Configuration ➜ API Keys and find the keys that belong to the account named in the rate limit audit event. A key in the Last used column with a time in the last few minutes is the likely source. The purpose recorded when the key was created often names the script or tool. If the account has several recently used keys, the IP address in the rate limit audit event tells you which machine is sending the requests.
Self-Hosted Octopus Server Only
- Turn on web request logging (self-hosted only). Use this when you need request counts, or when you run a version of Octopus Server older than 2026.3. On each Octopus Server node, run:
Octopus.Server.exe configure --requestLoggingEnabled=true
Octopus.Server.exe service --stop --start
Octopus writes a new log file each day in the W3C extended format and keeps 7 days of files. Each line records the method, URL path, port, username, client IP address, status code, and time taken. Leave logging on until the excess traffic has happened again.
-
Count requests by account and path (self-hosted only). On each Octopus Server node, run this PowerShell script that leverages the Octopus REST API. It lists the 10 busiest username and IP address pairs, then the 10 paths the busiest account requested most. Change
$logFolderif your Octopus home directory isn't the default.
$logFolder = 'C:\Octopus\Logs'
$requests = Get-ChildItem $logFolder -Filter '*.log' |
Get-Content |
Where-Object { $_ -and $_ -notlike '#*' } |
ForEach-Object {
$f = $_ -split '\s+'
[pscustomobject]@{ Path = $f[3]; User = $f[5]; IP = $f[6]; Status = $f[7] }
}
$busiest = $requests | Group-Object User, IP |
Sort-Object Count -Descending |
Select-Object -First 10
Write-Host "`nTop 10 username and IP address pairs by request count"
$busiest |
Select-Object @{ Name = 'Requests'; Expression = { $_.Count } },
@{ Name = 'Username'; Expression = { $_.Group[0].User } },
@{ Name = 'IP address'; Expression = { $_.Group[0].IP } } |
Format-Table -AutoSize | Out-Host
$topUser = $busiest[0].Group[0].User
Write-Host "Top 10 paths requested by $topUser"
$requests | Where-Object User -eq $topUser |
Group-Object Path |
Sort-Object Count -Descending |
Select-Object -First 10 @{ Name = 'Requests'; Expression = { $_.Count } },
@{ Name = 'Path'; Expression = { $_.Name } } |
Format-Table -AutoSize | Out-Host
The same path requested thousands of times usually means a script is polling in a loop, for example checking a task's status. A username of - means the requests weren't signed in, so use the IP address to find the client. In a high availability cluster, add up the counts from every node, because each node only logs the requests it served.
- Turn off web request logging (self-hosted only). On each Octopus Server node, run:
Octopus.Server.exe configure --requestLoggingEnabled=false
Octopus.Server.exe service --stop --start
Stop the Excess Traffic
Contact the owner of the account or key and change the integration via one of the following methods (if available in your current version of Octopus Server):
- Give each integration its own service account. Rate limits and request logs both work per user, so a shared account hides which tool is responsible, and one noisy tool can use up the others' quota.
- Connect AI agents with an agent API key. Agent keys count against their own rate limit policy, so agent traffic doesn't crowd out people.
- Increase the interval between status checks, and stop polling once a task finishes.
- Have clients read the
Octopus-RateLimitandRetry-Afterresponse headers and back off before they're rejected. In the Octopus C# client, setUseRateLimitHeaderstotrueonOctopusClientOptions(release 22.10.2889 or newer). - If the key is causing an outage and you can't reach its owner, revoke it from the API Keys page. Anything using the key stops working straight away.
Verify
After the integration is changed, confirm the traffic has dropped:
- In Configuration ➜ Audit, no new rate limit events appear for the account for at least an hour.
- On the API Keys page, the key's Last used time matches how often the integration is meant to run.
- On self-hosted Octopus Server, if you turn web request logging back on and rerun the PowerShell script from the Steps section, the account is no longer at the top of the list.
Once the traffic is under control, go to Configuration ➜ Settings ➜ Rate Limiting and turn off Audit mode on each policy you changed, so the rate limiter rejects excess requests with HTTP 429 from now on.
If the traffic continues, or the audit log shows no rate limit events while Octopus is still slow, contact our support team. Include when the problem started and any accounts or IP addresses you've ruled out. On self-hosted Octopus Server, attach the web request logs and the OctopusServer.txt server log from each node.
Related
- Rate limiting: how the rate limiter works, its policies, response headers, and audit mode.
- Enable web request logging: the request log format and tools for analyzing it.
- Create an API key: creating, scoping, and managing API keys, including agent API keys.
- Service accounts: setting up a dedicated account for each integration.
- Auditing: what the audit log records and how to filter it by API key.