OCR & Container Tuning
Redis 7 Memory Limits & OCRmyPDF /tmp Scratch Optimization
Prevent Redis queue growth during 2,000-PDF imports and size tmpfs vs disk-backed /tmp scratch safely.
128-256 MB Redis Maxmemory · 2-4 GB /tmp Scratch Headroom
Never Set volatile-lru on the Celery Broker
Unlike cache-only Redis instances, Paperless-ngx uses Redis 7 as the Celery task broker and result backend. Use maxmemory-policy noeviction with an explicit 128-256 MB ceiling so queued scan jobs are never silently dropped.
Bind-Mounting /tmp Off OverlayFS
On large multi-hundred-page PDFs, Ghostscript temp files inside container writable layers can bloat Docker overlay2. Bind-mount a dedicated host /tmp/paperless scratch path on NVMe.
Measured Thresholds & Container Limits
| Batch Ingestion Rate | Redis maxmemory | Peak /tmp Scratch Space | Scratch Storage Target |
|---|---|---|---|
| 20 - 100 PDFs/hr | 128 MB (noeviction) | ~1.0 GB | Container /tmp or NVMe |
| 100 - 500 PDFs/hr | 192 MB (noeviction) | ~2.5 GB | Host NVMe bind mount |
| 500 - 2,000 PDFs/hr | 256 MB (noeviction) | ~6.0 GB | Dedicated NVMe /tmp volume |