Skip to main content
FINOPS DOCOCR COMPUTE // PAPERLESS-NGX OCR & PDF/A ARCHIVE STUDIO TESSERACT CONCURRENCY | TIKA + GOTENBERG | BASELINE 2026-11-17
PaperlessNGX
PaperlessNGX Affiliate Notice: Outbound /go/ links marked rel="sponsored" may earn a partner commission at zero added cost (Affiliate Policy).
OCR & Container Tuning

Tuning Postgres 16 shared_buffers & Work Mem for Large Vaults

Keep tag, custom-field, and date queries sub-25ms from 50k to 500k documents by sizing Postgres shared_buffers and effective_cache_size.

25% RAM shared_buffers · Sub-25ms Filter Queries at 500k Docs

Tuning Postgres 16 shared_buffers & Work Mem for Large Vaults
Telemetry baseline verified 2026-11-17 by DocOCR Compute.

Why Default Postgres 16 Config Bottlenecks Large Vaults

Stock Postgres Docker images boot with shared_buffers=128MB regardless of host memory. Once custom fields, audit logs, and document tags pass 100,000 rows, small shared buffers force constant disk reads during bulk UI filtering.

Balancing Postgres Against Tesseract Spikes

Cap db memory at ~25-30% of host RAM so Celery consumer bursts never collide with database cache allocations.

Measured Thresholds & Container Limits

Host RAMshared_bufferseffective_cache_sizedb Container Limit
2 GB (1-Slice)384 MB1024 MB512M
4 GB (2-Slice)1024 MB2048 MB1280M
8 GB (KVM 2 / 4-Slice)2048 MB4096 MB2560M
16-32 GB (KVM 4 / 8)4096 MB10240 MB5120M
25% RAM shared_buffers · Sub-25ms Filter Queries at 500k Docs Deploy $6/TB SliceHostinger KVM ($4.79/mo)