Skip to main content

Ingest Settings

The ingest section controls how the HTTP ingest endpoints accept data before it is flushed to immutable part files.

Accepted events first enter an in-memory batcher. They become durable only after LynxDB finishes writing and publishing the corresponding .lsg part.

Max Body Size

The maximum size of a single HTTP request body for ingest endpoints.

Config Keyingest.max_body_size
Env VarLYNXDB_INGEST_MAX_BODY_SIZE
Default100mb
ingest:
max_body_size: "100mb"

Requests exceeding this limit receive 413 Payload Too Large.

Max Batch Size

The maximum number of events accepted in one ingest request.

Config Keyingest.max_batch_size
Env VarLYNXDB_INGEST_MAX_BATCH_SIZE
Default1000
ingest:
max_batch_size: 1000

Max Line Size

The maximum size of a single raw log line.

Config Keyingest.max_line_bytes
Env VarLYNXDB_INGEST_MAX_LINE_BYTES
Default1mb
ingest:
max_line_bytes: 1048576

Parse Mode

Choose how much work LynxDB does during ingest.

Config Keyingest.mode
Env VarLYNXDB_INGEST_MODE
Defaultfull
ingest:
mode: "full"

Valid values:

ValueDescription
fullExtract JSON fields into columns during ingest. Default.
lightweightKeep most data in _raw and defer extraction to query time.

Durability and Part Flushes

The current ingest path does not write to a WAL. Instead:

  1. events are buffered in memory by AsyncBatcher
  2. a batch is serialized to a temporary part file
  3. the part is optionally fsync'd
  4. the file is atomically renamed into place

Events that have been accepted but not yet flushed are not durable.

ingest.fsync

Control whether LynxDB fsyncs each part file before the atomic rename.

Config Keyingest.fsync
Env VarLYNXDB_INGEST_FSYNC
Defaulttrue
ingest:
fsync: true
ValueBehaviorTradeoff
trueSync the part file before renameHigher durability, more flush latency
falseLeave durability to the OS page cacheFaster flushes, higher power-loss risk

Deduplication

Optional ingest deduplication helps with at-least-once delivery pipelines.

Config KeyEnv VarDefaultDescription
ingest.dedup_enabledLYNXDB_INGEST_DEDUP_ENABLEDfalseEnable xxhash64-based ingest dedup
ingest.dedup_capacityLYNXDB_INGEST_DEDUP_CAPACITY100000Number of recent hashes to retain

Ingest Endpoints

EndpointFormatDescription
POST /api/v1/ingestJSON event arraysPrimary structured ingest path
POST /api/v1/ingest/rawNewline-delimited raw textRaw log ingest
POST /api/v1/ingest/hecSplunk HEC JSONSplunk forwarder compatibility
POST /api/v1/ingest/bulkElasticsearch bulk formatAlias for the Elasticsearch compatibility bulk handler

Complete Example

ingest:
max_body_size: "100mb"
max_batch_size: 5000
max_line_bytes: 1048576
mode: "full"
fsync: true
dedup_enabled: false
dedup_capacity: 100000

Tuning Guidelines

ScenarioRecommendation
High-throughput ingestIncrease max_body_size and consider lightweight mode
Large raw log linesIncrease max_line_bytes
Stricter flush durabilityKeep fsync: true
Replay-heavy pipelinesEnable deduplication

Next Steps