Area: API Issues
Sub-Area: Rate Limiting and Throttling
Applies to: Cloud
Issue
You send metadata to DataHub Cloud with the DataHub CLI, the Python SDK, or a custom pipeline. Some writes fail with HTTP 429 (Too Many Requests). The DataHub server (GMS) rejected the write because a server throttle is active. The CLI retries 429 responses on its own. If the throttle is still active after the last retry, the emitter raises an OperationalError and the ingestion run fails.
Error Messages
The CLI and SDK wrap the server message. A typical Rest.li error looks like this:
datahub.configuration.common.OperationalError: ('Unable to emit metadata to DataHub GMS: Throttled due to [ThrottleEvent(backoffWaitMs={RATE_LIMIT=<ms>}, jitterRatio=2.0)]', {'exceptionClass': 'com.linkedin.restli.server.RestLiServiceException', 'message': 'Throttled due to [ThrottleEvent(backoffWaitMs={RATE_LIMIT=<ms>}, jitterRatio=2.0)]', 'status': 429})
The part that matters is Throttled due to [...]. It lists one ThrottleEvent per server throttle. The throttle that rejected your write is the one with a value above 0 inside backoffWaitMs.
You Might Be Asking
- Why does my DataHub CLI get HTTP 429 errors when it emits metadata?
- Which limit did I hit, and what are its thresholds?
- Does each retry count against the limit?
- How do I configure the CLI or SDK to back off and slow down?
- Can DataHub change the limits for my instance?
Cause
DataHub Cloud has two server throttles that reject writes with this message. The name inside backoffWaitMs tells you which one you hit.
RATE_LIMIT is a quota on the number of metadata changes. It is meant for DataHub Cloud free trial instances. It turns on only when both of these are true:
- More than 100,000 changes were written in the current activation interval (default 24 hours). This count is not a rolling window. It resets to zero on a fixed timer every interval.
- At least 30,000 changes were written in the last 5 minutes. This is a rolling window.
These are the default values. Each aspect write counts as one change, so a batch of 100 proposals counts as 100. Each GMS server pod keeps its own counts. Writes that the throttle rejects are not counted, so retries do not make the throttle worse. Edits you make in the DataHub UI are never throttled.
If a paid DataHub Cloud instance returns RATE_LIMIT, contact DataHub Support.
MCL_VERSIONED_LAG or MCL_TIMESERIES_LAG means DataHub is behind on processing earlier changes (search indexing and other downstream work). While that backlog is above a threshold, the server rejects new synchronous writes. This throttle clears when the backlog drains, not after a fixed time window.
Some instances also have endpoint rate limits. These are separate from the throttles above. They return HTTP 429 with an x-datahub-ratelimit-endpoint-rule header that names the rule that rejected the request. If you see that header, contact DataHub Support.
Solution
Step 1: Read the wait time
backoffWaitMs is the server's minimum wait in milliseconds. The server adds random jitter to that wait so that clients do not all retry at once. With jitterRatio=2.0, the actual wait is between backoffWaitMs and 3 times backoffWaitMs. GMS sends this wait in the Retry-After header of the 429 response. The DataHub emitter honors Retry-After and waits that long before it retries.
If a run already failed, wait at least 3 times backoffWaitMs, then run it again.
Step 2: Give the emitter more retries
The emitter retries failed requests on its own, so you don't need your own retry loop. Two environment variables control this:
# Retries for a failed request (default: 4)
export DATAHUB_REST_EMITTER_DEFAULT_RETRY_MAX_TIMES=4
# Multiplies the number of retries allowed for 429 responses (default: 2)
export DATAHUB_REST_EMITTER_429_RETRY_MULTIPLIER=2
DATAHUB_REST_EMITTER_429_RETRY_MULTIPLIER does not change the wait between retries. It only changes how many times a 429 is retried. With the defaults, a request that keeps getting 429 is retried up to 8 times (4 × 2). To ride out a longer throttle, raise either value.
In a CLI recipe, you can also set the retry count on the datahub-rest sink with retry_max_times. See the DataHub sink documentation.
Step 3: Reduce parallelism
The datahub-rest sink sends writes on 15 threads by default. Lower max_threads to slow the write rate:
sink:
type: datahub-rest
config:
server: "https://<your-instance>.acryl.io/gms"
token: "<your-personal-access-token>"
max_threads: 4
retry_max_times: 8
max_threads and retry_max_times are documented in the DataHub sink documentation.
Step 4: Pace custom SDK scripts
If you emit metadata from your own Python script, send it in batches with a pause between them. DataHub Cloud needs a personal access token in token:
import time
from typing import List
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.rest_emitter import DatahubRestEmitter
emitter = DatahubRestEmitter(
gms_server="https://<your-instance>.acryl.io/gms",
token="<your-personal-access-token>",
retry_max_times=8,
)
BATCH_SIZE = 500
INTER_BATCH_DELAY_SECONDS = 5 # raise this if you still see 429s
mcps: List[MetadataChangeProposalWrapper] = [] # fill with your proposals
for i in range(0, len(mcps), BATCH_SIZE):
for mcp in mcps[i : i + BATCH_SIZE]:
emitter.emit_mcp(mcp)
time.sleep(INTER_BATCH_DELAY_SECONDS)
See the Python Emitter documentation for more on the emitter.
Step 5: Stagger schedules
All sources that write to your instance add to the same load: UI ingestion sources, CLI runs, SDK scripts and CI/CD jobs. Don't start several large jobs at the same time. Spread their start times apart, and run the largest ones one after another.
# Instead of starting all jobs at midnight:
# 0 0 * * * pipeline_a
# 0 0 * * * pipeline_b
# 0 0 * * * pipeline_c
# Spread them out:
0 0 * * * pipeline_a
15 0 * * * pipeline_b
30 0 * * * pipeline_c
Additional Notes
You can't change throttle settings on a DataHub Cloud instance. If your instance still gets 429 errors after you apply the steps above, contact DataHub Support with the full error message and the time it happened.