Area: Deployment Issues
Sub-Area: Remote Executor Configuration
Applies to: Cloud
Issue
Ingestion runs on a Remote Executor fail or the executor runs out of memory during large ingestions, for example BigQuery sources with many projects or datasets, or several warehouse runs at the same time.
You Might Be Asking
- Why are my previously working ingestion jobs now failing for lack of memory?
- How can I reduce memory use on the Remote Executor?
- How much memory does the Remote Executor need for large BigQuery ingestion?
Cause
Memory use is per concurrent ingestion run. One run uses from about 100 MB up to 4 to 6 GB, and sometimes more. Snowflake, BigQuery and Redshift runs routinely peak around 4 to 6 GB. If several large runs happen together, the peaks add up (n warehouse runs together can need about n x 6 GB). The executor process and each Observe task also use memory.
Solution
1. Size the executor for concurrent runs
- Size memory for the peak of all runs that can happen at the same time, and stagger large runs.
- CPU needs about 1 + n + k cores, where n is the number of concurrent ingestion runs and k is 1 if you use Observe. If you raise worker counts, add cores too.
- The Terraform module defaults are
cpu1024 andmemory2048 (MiB). Raisecpuandmemoryin the module inputs for large runs. - On Kubernetes, the full list of
datahub-executor-workerchart options is in the chart's values.yaml.
See Remote Executor best practices for sizing details.
2. Lower concurrency on the executor
DATAHUB_EXECUTOR_INGESTION_MAX_WORKERS sets the maximum number of concurrent ingestion tasks (default 4). Lowering it reduces peak memory. On the Helm chart, set it under extraEnvs:
extraEnvs:
- name: DATAHUB_EXECUTOR_INGESTION_MAX_WORKERS
value: "2"
See Performance settings and task weight-based queuing.
3. Make big sources run alone with a task weight
Each task has a weight of 1 / ingestion max workers by default (0.25 with 4 workers). New tasks queue while the total weight of running tasks would exceed 1.0. To make one source run alone, open the ingestion source and add this under Extra Environment Variables:
{ "EXECUTOR_TASK_WEIGHT": "1.0" }
4. Cap memory for one source (optional)
Add EXECUTOR_TASK_MEMORY_LIMIT under Extra Environment Variables for the source (see Performance settings). The value is an integer number of bytes. The executor applies it as a cap on the ingestion process's virtual address space. For about 6 GB, use about 6000000000:
{ "EXECUTOR_TASK_MEMORY_LIMIT": "6000000000" }
A value like 6000000 is only about 6 MB. Because the cap applies to virtual memory, not resident memory, leave headroom above the expected peak. The operator guide describes this value as kilobytes. That is wrong. The value is bytes. The task log shows Setting memory limit to <N> bytes. If the value isn't a valid integer, the log shows Warning: Failed to set memory limit: ....
5. Reduce parallelism in the BigQuery recipe
The recipe rejects keys it doesn't know, so use only real keys. The parallelism settings are max_threads_dataset_parallelism (dataset metadata threads), profiling.max_workers and classification.max_workers. A top-level max_workers key in a BigQuery recipe fails validation, so remove it if you have one:
source:
type: bigquery
config:
max_threads_dataset_parallelism: 2
profiling:
max_workers: 2
classification:
max_workers: 2
See the BigQuery source configuration.
6. Limit the scope of the recipe
project_ids lists the projects to ingest. dataset_pattern is a regex allow and deny list on the dataset name.
BigQuery patterns are regexes matched from the start of the string. table_pattern is matched against project.dataset.table, so to exclude tables by name, use a pattern that starts with .*\.:
source:
type: bigquery
config:
table_pattern:
deny:
- '.*\.temp_.*'
- '.*\.staging_.*'
A bare temp_* only matches when the project ID itself starts with temp.
7. Check profiling, classification and lineage options
profiling.enabled and classification.enabled both default to false. Lineage and query options are top-level BigQuery fields: include_table_lineage (default true) and use_queries_v2 (default true). If an older recipe has a lineage: block with use_v2_lineage_api, remove it. Set lineage options at the top level instead.
8. Check disk, not only memory
Dynamic venvs are built per run under /tmp/datahub/ingest/<execution-id>/. Size ephemeral storage for the largest venv, the uv cache and retained logs. On Fargate with Terraform, ephemeral_storage = { size_in_gib = N } sets this. The default is 20 GiB. See best practices.
9. Confirm what the run used
Each ingestion run's report includes mem_info and peak_memory_usage. Use them to size the next change.
10. Add connectors with a custom image
To add connectors, build a custom image from an unlocked base (:tag or :tag-slim, never :tag-locked) with the documented Dockerfile.bundled. See Bundling additional connectors.