Logstash Queue Durability: Choosing In-Memory or Persistent Queues
Decide when to use Logstash persistent queues versus in-memory queues, with config, permission, and validation steps.
28 Aug 2025, 07:13 UTC

Decision: protect in-flight events or minimize latency
Logstash holds events that have been received but not yet fully processed in a queue. By default that queue lives in memory. If the Logstash process crashes, the host restarts, or you stop the service, events sitting in that in-memory queue are lost. Persistent queues write those unacknowledged events to local disk before acknowledging them, so they survive a restart.
Use this guide when you are deciding queue.type in logstash.yml and need to weigh event durability against disk I/O and throughput.
Constraints to check first
- Local disk only. Persistent queue data must not reside on a network filesystem.
- Enough free disk space for the queue plus headroom for traffic bursts.
- The Logstash system user must own and write to the queue path.
- Changing
queue.typerequires a Logstash restart and may leave old queue files on disk.
Supported options compared
| Factor | In-memory (default) | Persistent (disk-backed) |
|---|---|---|
queue.type value | memory | persisted |
| Event survival on crash or restart | Events in the queue are lost | Unacknowledged events remain on disk |
| Latency | Lower | Higher, due to disk writes |
| Throughput ceiling | Memory and CPU bound | Often disk I/O bound |
| Disk space required | None for the queue | Local disk for queue files |
| Best for | Non-critical data, testing, pipelines where loss is acceptable | Critical events where replay or loss is unacceptable |
Trade-offs
Persistent queues convert a memory problem into a disk problem. A slow disk, a disk shared with logs or databases, or a full filesystem can cause the queue to back up and apply backpressure to inputs. The Dead Letter Queue (DLQ) is a separate feature: it captures events that outputs reject, not events waiting in the pipeline. Enabling persistent queues does not replace output acknowledgment, replication, or backups.
Implementation: enable persistent queues
Edit logstash.yml on the Logstash host. A typical location is /etc/logstash/logstash.yml.
queue.type: persisted
queue.path: /var/lib/logstash/queues
Run the following as root or with sudo. The path /var/lib/logstash/queues is a placeholder; adjust it to your installation.
# Run on the Logstash host
sudo mkdir -p /var/lib/logstash/queues
sudo chown -R logstash:logstash /var/lib/logstash/queues
sudo chmod 750 /var/lib/logstash/queues
Restart Logstash so the new queue type takes effect. If you previously used an in-memory queue, old in-memory state does not carry over; persistent queue files are created under queue.path when events arrive.
Tune pipeline settings together with the queue. A large batch.size or many pipeline.workers can fill a persistent queue faster than outputs drain it. Start with defaults, then adjust only after measuring queue depth under load.
Validation
- Confirm the setting:
grep -R "queue.type" /etc/logstash/should returnqueue.type: persisted. - Confirm the directory: the
queue.pathdirectory must exist, be writable by thelogstashuser, and reside on local disk. - Check Logstash startup logs for queue initialization errors. A permission error or read-only filesystem appears at startup.
- Under load, monitor disk usage on the queue filesystem and Logstash logs for signs of saturation, such as a growing queue or blocked inputs.
To verify durability, plan this check: pause the input, stop Logstash abruptly while events are queued, restart, and confirm processing resumes from the queued events. This is a destructive operational check; run it in a non-production environment first.
Limitations
- Persistent queues protect in-flight events only. They are not a backup, replica, or substitute for output acknowledgment.
- DLQ events must be drained separately; they can accumulate if unprocessed.
- Disk contention or insufficient space can reduce throughput or block the pipeline.
Rollback
Changing queue.type changes state. To revert:
- Stop Logstash.
- Edit
logstash.ymland setqueue.type: memoryor remove the line to restore the default. - Remove or archive the persistent queue files under
queue.path. Deleting queue files discards any unprocessed events they contain. - Restart Logstash.
Practical check
After any change, run Logstash with a representative input and output, then confirm events flow end-to-end and that the queue directory shows activity under load without growing without bound.