Pipeline optimization
Symptom-to-page routing table for Nilus pipeline optimization, plus the measurement loop and common tuning knobs shared across guides.
Pipeline optimization is a measured change to improve one of three outcomes: shorter runtime, lower resource use, or a better destination layout.
Optimize only with a symptom
Pipeline takes too long
Pipeline uses too much CPU or memory
CDC lag, snapshot OOM, or Debezium heap pressure
Validating, testing, or doing a partial backfill
Destination has too many files, poor partitioning, or costly queries
Pipeline fails or produces unexpected data
Measurement loop
Capture the current run: status, duration, records processed, CPU, memory, source object, destination, and config.
Pick one hypothesis: extraction bottleneck, load bottleneck, destination layout, source throttling, or resource pressure.
Change one knob.
Run the same workload again.
Compare duration, throughput, cost, and destination correctness.
Keep the change only if it improves the symptom without hiding a correctness issue.
Common knobs
page_size
source.options
Reducing memory pressure or API/page overhead.
extract_parallelism
source.options
Increasing supported extraction concurrency.
loader_file_size
sink.options
Reducing small files or loader batch overhead.
partition_by
sink.options
Improving Lakehouse query pruning.
cluster_by
sink.options
Improving locality for common filters where supported.
LOAD__WORKERS
Runtime environment
Increasing destination load worker concurrency for large writes.
NORMALIZE__WORKERS
Runtime environment
Increasing normalization worker concurrency for wide or nested data. Keep the default on CDC pipelines.
NILUS_JVM_HEAP_PERCENT
Runtime environment
CDC only: share of pod memory given to the embedded Debezium JVM. See Optimizing CDC for the tested 12 GiB / 30% / 500k–700k reference.
Set runtime environment variables under runtime.env.
For the full knob reference, including placement, defaults, valid values, and symptoms, see Optimizing for Time (throughput and validation-sampling knobs) and Optimizing for Resource (memory/CPU and width-sampling knobs). For CDC heap and queue tuning, see Optimizing CDC. For how the destination dataset is physically laid out, see Optimize Sink Datasets.
Recommended profiles
Use these as starting points. Tune each profile for available CPU, memory, and source limits.
Faster: throughput-oriented
For large lakehouse or warehouse loads where wall-clock time matters more than resource cost.
Lower-resources: memory/CPU-conservative
For shared runtimes, tight pod budgets, or pipelines that previously OOMKilled.
Balanced: default starting point
The shape of most well-behaved pipelines.
Sizing playbook
Use this process for a new pipeline with unfamiliar data.
Baseline. Run once with defaults and conservative compute. Record runtime, peak CPU/memory, network throughput, and destination file count. If the run gets OOMKilled, prioritize memory mitigations: lower
extract_parallelism, lowerLOAD__WORKERS, lowerpage_sizeto 25k, and keeploader_file_sizelarge.Size files first. Estimate
row_bytes ≈ raw_table_size_bytes / total_rows. Target Parquet files of 128–512 MB. Useloader_file_size ≈ target_file_bytes / row_bytes, then checkexpected_files = ceil(total_rows / loader_file_size). Aim for 20–200 files for a very large table.Bound memory via
page_size. Estimate page memory aspage_size × row_bytes. Choosepage_sizeso peak RSS stays well under pod memory. Start at 50k–100k; drop to 25k–50k for OOM-prone or wide-row pipelines.Set parallelism from available CPU.
extract_parallelismandLOAD__WORKERSnear 60–80% of allocatable vCPU is a good starting point. KeepNORMALIZE__WORKERSlow (1–2). On CDC pipelines, leaveNORMALIZE__WORKERSandLOAD__WORKERSat defaults. See Optimizing CDC. Useparallelfor lakehouse and most warehouses; usesequentialfor fragile or strictly locked destinations.Validate on a slice. Use
sql_limitor a tightinterval_start/interval_endwindow to confirm sizing, memory headroom, and file count on a partial run before scaling to the full dataset. See Optimizing for time.Iterate by bottleneck:
Long commit tail → raise
loader_file_size.Low CPU, long runtime → raise
extract_parallelismand/orLOAD__WORKERS.Source throttling → lower
extract_parallelismorpage_size.Memory spikes → lower parallelism first; only then lower
page_size.
Add partitioning last. Align
partition_bywith consumer queries. Confirm each partition still hits a healthy file size. High-cardinality partitions that produce tiny files cost more than they save. See Shape knobs.
Related docs
Last updated
Was this helpful?