Area: Deployment Issues
Sub-Area: GMS Performance / Extraction Job Misconfiguration
Applies to: OSS + Cloud
Issue
DataHub becomes slow for everyone. Pages load slowly, search is slow, and some requests time out. The cause is an external script or extraction job that reads metadata from DataHub through the GraphQL API. Instead of reading only what changed, the job pulls the full result set on every run. Each run sends many large GraphQL queries to GMS (the DataHub metadata service), and those queries compete with UI and API traffic on the same GMS pods.
The operation names in the logs belong to the caller. For example, searchLogicalDatasets or getPhysicalDatasetOverview are names a customer script gave its own queries. They are not DataHub APIs.
Error Messages
GMS logs a line for each GraphQL operation that takes 1000 ms or longer (the default threshold). On a self-hosted deployment the line looks like this:
Slow operation <operationName> took <duration> ms (response size: <size>)
<operationName> is the operation name the client sent with the query. <size> is the length of the JSON response in characters.
You Might Be Asking
- Why is DataHub slow even though infrastructure metrics look normal?
- Why are unrelated GraphQL queries slow at the same time?
- How do I tell whether a script or background job is causing GMS slowness?
- What does it mean when one operation shows up hundreds of times with the same large response size?
- Should I raise GMS or Elasticsearch timeouts to fix this?
Cause
GMS builds each GraphQL response as one JSON string in memory before it sends it. A query that asks for many entities, many fields, or nested data produces a large response, holds a GMS thread while it runs, and uses heap on that pod. When a job sends these queries in a loop, the load lands on the same pods that serve the UI, so unrelated queries slow down too.
GMS stops waiting for a GraphQL request after 55000 ms by default (DATAHUB_GMS_ASYNC_REQUEST_TIMEOUT_MS). Requests that run longer than that fail with a timeout.
Adding GMS replicas spreads the same load over more pods. It does not reduce the load. The fix is in the caller.
Solution
Step 1: Find the operation that causes the load
- Self-hosted: collect GMS logs for one hour during the slow period. Find the
Slow operationlines and group them by operation name. DataHub Cloud: contact DataHub Support and ask them to check the GMS slow operation logs for that window. - Look for one or a few operation names that account for most of the slow lines. A job doing full pulls shows up as the same operation name repeated many times, often with the same large response size each time.
- Match the operation name and the timestamps to a job you run against DataHub. Check whether the job's schedule overlaps the slow period.
Step 2: Pause the job to confirm
- Pause the job for at least one hour during normal traffic.
- Compare the number of
Slow operationlines and UI response times for that hour with the hour from Step 1. - If the slow lines from that operation disappear and the UI recovers, the job is the cause. You don't need to change your DataHub deployment.
Step 3: Fix the job
Follow GraphQL Best Practices for every query the job sends.
- Request only the fields the job needs. Don't fetch nested data you don't use.
- Page through results in small pages. Don't fetch a whole result set in one call.
- For large result sets, use
scrollAcrossEntities, notsearchAcrossEntities.search*queries are meant for shallow paging and can't page past 10,000 results. Sort byurnso the order stays stable, and turn off aggregates and highlighting:
query ScrollDatasets($scrollId: String) {
scrollAcrossEntities(
input: {
types: [DATASET]
query: "*"
count: 100
scrollId: $scrollId
searchFlags: { skipAggregates: true, skipHighlighting: true }
sortInput: { sortCriteria: [{ field: "urn", sortOrder: ASCENDING }] }
}
) {
nextScrollId
total
searchResults {
entity {
urn
}
}
}
}
Send the first request with no scrollId. Pass each response's nextScrollId as scrollId in the next request. Stop when nextScrollId is null.
- Make the job incremental. If the job is meant to do one full pull and then only read changes, check that it saves its last successful run time or cursor to storage that survives between runs, reads it at startup, and only updates it after a run succeeds. If that value is lost or reset on each run, every run becomes a full pull.
- Run the fixed job once outside business hours. Check that it sends far fewer requests and that the
Slow operationlines for its queries are gone or much smaller.
Step 4: Spread the job's load
- Schedule the job outside peak hours.
- If the job must run during business hours, limit how many requests it sends at once and add a pause between pages so its requests don't arrive in bursts.
Step 5: GMS timeout settings (self-hosted only)
These GMS environment variables set timeouts and thread counts. Their defaults are:
| Variable | Default | What it sets |
|---|---|---|
DATAHUB_GMS_ASYNC_REQUEST_TIMEOUT_MS |
55000 |
How long GMS waits for an async request, such as a GraphQL request |
ELASTICSEARCH_SOCKET_TIMEOUT |
30000 |
Elasticsearch client socket timeout, in ms |
ELASTICSEARCH_CONNECTION_REQUEST_TIMEOUT |
5000 |
How long GMS waits for an Elasticsearch connection, in ms |
ELASTICSEARCH_THREAD_COUNT |
2 |
Elasticsearch client thread count |
ELASTICSEARCH_SEARCH_GRAPH_TIMEOUT_SECONDS |
50 |
Graph query timeout, in seconds |
Raising a timeout lets a heavy request run longer before it fails. It does not remove the load the job puts on GMS and Elasticsearch, so fix the job first. See Deployment Environment Variables for the full list.
DataHub Cloud customers can't change these settings. Contact DataHub Support if you think a GMS setting needs to change.
Related Documentation
Tags: gms-slowness, request-timeout, extraction-job, full-pull, graphql-performance, scrollAcrossEntities, pagination, self-hosted, performance