Throughput knobs
Settings that control pipeline speed: page size, extract parallelism, loader file size, and worker counts.
These knobs decide how quickly and how cheaply a run completes. Tune these only after you have a concrete bottleneck. Pre-emptive tuning is rarely worth it.
loader_file_format (sink)
sink.options
conditional auto-default (see below)
parquet, jsonl, csv, insert_values
Controls the staging file format the loader writes before committing to the destination.
Auto-default behavior: if loader_file_format is unset, Nilus picks parquet automatically when the destination scheme is one of duckdb, snowflake, databricks, synapse, s3. For every other destination (BigQuery, DataOS Lakehouse, Redshift, MS SQL Server, MongoDB, Elasticsearch, AWS S3 file-system, PostgreSQL, MySQL), the loader uses the destination's native default, frequently JSONL or insert-values, which is materially slower for analytic workloads.
parquet
Lakehouse (DataOS Lakehouse, S3, GCS), Snowflake, BigQuery, Databricks, Synapse, DuckDB
Columnar, compressed, far smaller and faster than JSONL for analytic targets.
jsonl
Document-oriented destinations (MongoDB, Elasticsearch); JSON-returning REST sources
Preserves nested structures losslessly.
csv
DuckDB, S3 (CSV consumer downstream)
Verbose; only when downstream tools require CSV.
insert_values
Relational destinations (PostgreSQL, MySQL, MS SQL Server, Redshift)
Inline INSERT … VALUES statements. Fine for small tables; use parquet + warehouse external-stage for large tables on Snowflake / BigQuery / Redshift.
loader_file_size (sink)
sink.options
100000 (rows per file)
integer
How many rows the loader writes per output file before rotating to the next one.
Controls the loader's per-file row count (the rotation threshold). The job-count metric you see in logs is "X pages of page_size rows". The file count is ceil(total_rows / loader_file_size).
Long commit tail (jobs at 100% but the run continues for minutes)
Raise loader_file_size
Fewer files → fewer Iceberg/manifest commits.
Single-file retries are slow on transient network failures
Lower loader_file_size
Each retry re-uploads less data.
Destination has thousands of tiny files
Raise loader_file_size
One target Parquet file should be ~128–512 MB.
Sizing heuristic
Estimate per-row size in bytes:
row_bytes ≈ raw_table_size_bytes / total_rows.Pick a target Parquet file size: 128–512 MB is healthy on object storage.
loader_file_size ≈ target_file_bytes / row_bytes.Sanity-check:
expected_files ≈ ceil(total_rows / loader_file_size). Aim for 20–200 files per very large table to keep commit time low.
For wide rows (1 KB+), 200k–350k rows per file is a good starting point.
page_size (source)
source.options
50000 (rows per page)
integer
How many rows are buffered in memory per extraction page before being flushed to the loader.
Controls the in-memory writer buffer (rows held before flush). Despite the name, it does not control source-side pagination for SQL sources (the SQL backend uses its own chunking). It controls the writer buffer, which is the dominant memory consumer during extraction.
Pipeline is OOMKilled
Lower page_size (try 25000 or 10000)
Smaller buffer per page.
Source is hammered with too many small queries
Raise page_size (try 100000+)
Fewer, larger reads.
Wide rows (1 KB+) blow the runtime memory
Lower page_size to keep page_size × row_bytes under a comfortable fraction of pod memory
Page memory bound is roughly page_size × row_bytes.
Tuning range: 10000 to 150000 is normal. Going higher requires a chunky source (slow connection setup) and ample runtime memory.
extract_parallelism (source)
source.options
5
integer
Number of concurrent extraction workers per pipeline.
Controls the extractor's worker count and per-worker parallelism.
CPU is low, run is long
Raise extract_parallelism toward available vCPU
More concurrent reads.
Source database throttles or rejects connections
Lower extract_parallelism
Fewer concurrent reads.
Memory spikes during extraction
Lower extract_parallelism
Each worker holds its own page buffer.
Tuning range: 2 to 8 for most pipelines. Higher only if the source is concurrency-safe and the runtime has the CPU/memory headroom.
staging_bucket (sink)
sink.options
unset
string, must be gs:// or s3:// prefixed
External staging bucket for warehouses that benefit from external-stage loads (BigQuery, Snowflake, Redshift). Without it, the loader streams rows directly into the warehouse, which is bandwidth-bound and slow for very large extracts.
The bucket must be writable by the destination's service principal (BigQuery service account, Snowflake STAGE, etc.). For BigQuery specifically, the bucket must live in the same region as the destination dataset.
DATA_WRITER__FILE_MAX_BYTES (env var)
spec.use.projection.projections.envVars
134217728 (128 MB)
integer (bytes)
Per-file byte cap for Iceberg (Lakehouse) writes. Controls the byte threshold at which Nilus closes the current Parquet file and starts a new one. The primary file-size lever for DataOS Lakehouse destinations.
When you want this byte cap to govern, set loader_file_size high (e.g. 2000000000) so the row-count threshold is never reached first.
Long commit tail (jobs at 100% but run continues for minutes)
Raise toward 512 MB
Fewer files, fewer Iceberg manifest commits.
Peak memory too high on a Lakehouse load
Lower toward 128 MB
Smaller open file buffers.
Destination has thousands of tiny files
Raise toward 512 MB or 2 GB
One healthy Parquet file should be 128-512 MB.
Common values: 134217728 (128 MB, default), 536870912 (512 MB, queryable), 2147483648 (2 GB, non-queryable fastest). For benchmark results by table shape, see Tuning Large Lakehouse (Iceberg) Loads.
LOAD__WORKERS (env var)
spec.use.projection.projections.envVars
engine default (typically 5)
integer
Loader concurrency: how many parallel workers stage, write, and commit output files. Different from extract_parallelism, which governs the read side.
This is the single biggest throughput knob for write-heavy pipelines once loader_file_size and loader_file_format are sensible. Raise until CPU or object-store bandwidth saturates, then back off one notch.
EXTRACT__WORKERS (env var)
spec.use.projection.projections.envVars
engine default
integer
Extraction-side worker count. Raise alongside LOAD__WORKERS for balanced throughput on large Iceberg loads.
EXTRACT__MAX_PARALLEL_ITEMS (env var)
spec.use.projection.projections.envVars
engine default
integer
Maximum number of source items processed in parallel during extraction. Useful for connectors that support parallel object reads.
NORMALIZE__WORKERS (env var)
spec.use.projection.projections.envVars
engine default (typically 1)
integer
Concurrency for normalization / type coercion between extract and load. Most pipelines do not need to raise this beyond 1 to 2. Raise only if profiling shows normalization is the bottleneck (rare).
LOAD__PARALLELISM_STRATEGY (env var)
spec.use.projection.projections.envVars
engine default (unset)
parallel, sequential
How the loader schedules load units (tables/resources) across workers.
parallel
Lakehouse and warehouse destinations that handle concurrency well (DataOS Lakehouse, BigQuery, Snowflake, Databricks).
sequential
Fragile destinations or destinations with strict locking semantics (some MS SQL Server / Synapse setups, Elasticsearch with conservative cluster sizing).
Combined env-var example:
Last updated
Was this helpful?