Prompt
Why is my stream processing job dropping records under load?
Latest observation
Oct 24, 2026
OpenAI APIWeb search: off
Records usually get “dropped under load” in stream jobs for one of a few broad reasons:
Common causes
-
Backpressure / slow downstream
- Your job can’t keep up with ingest rate, so buffers fill.
- Some systems then start rejecting input, timing out, or shedding load.
-
Insufficient partitioning or parallelism
- One hot partition, key, or shard becomes a bottleneck.
- Other workers are idle while one lagging task drops behind.
-
Memory pressure / GC / OOM
- High allocation rates cause long GC pauses or out-of-memory behavior.
- Messages may be lost if the process restarts or if buffers overflow.
-
Checkpointing / state store issues
- If checkpointing is too slow or failing, the pipeline may restart and skip or duplicate depending on semantics.
- State backends under stress can stall processing.
-
Consumer lag and retention
- The upstream system may overwrite data before you read it.
- Example: Kafka offsets fall behind log retention; records appear “missing.”
-
At-most-once configuration
- Some stream systems are configured for throughput over reliability.
- Failures then cause data loss by design.
-
Batching / timeout thresholds
- Large micro-batches, long flush intervals, or strict timeouts can cause records to be evicted or failed.
-
External sink throttling
- A database, API, or warehouse sink can’t absorb writes fast enough.
- The sink may reject writes, and your job may not retry correctly.
-
Resource contention
- CPU saturation, disk I/O bottlenecks, network congestion, noisy neighbors, or container limits can all reduce throughput.
What to check first
- Metrics: consumer lag, processing latency, queue/buffer depth, rejected messages, GC time, restart count, checkpoint duration, sink error rate.
- Delivery semantics: at-most-once vs at-least-once vs exactly-once.
- Partition distribution: are keys skewed?
- Upstream retention: are you falling behind long enough to lose data?
- Retries and dead-letter handling: are failed records being retried or discarded?
- Logs: look for timeouts, backpressure warnings, serialization errors, and OOM/GC events.
Fast diagnosis pattern
- If lag increases steadily: throughput bottleneck.
- If errors spike when load peaks: capacity or timeout issue.
- If records vanish after restart: delivery semantics/checkpointing problem.
- If only some keys disappear: partition skew/hot key issue.
- If sink failures correlate with drops: downstream rejection without proper retry.
If you want, I can help you debug it systematically if you tell me:
- the streaming framework (Kafka Streams, Flink, Spark, Beam, etc.),
- the source and sink,
- whether you have exactly-once enabled,
- and any relevant metrics/logs.