Compare commits

..
Author SHA1 Message Date
claude-botandClaude Fable 5.1 f8aa65362b fix(paperless): cap OCR at 5 threads per worker
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
Unset, paperless derives cpu_count / TASK_WORKERS, i.e. 20 parallel
ocrmypdf workers on k8s-1. Memory during OCR scales with that count, so
the limit alone is not enough headroom for large scans.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 21:26:35 +02:00
claude-botandClaude Fable 5.1 0ce0391bb1 fix(paperless): raise the memory limit to 4Gi
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
An 18 MB scan from the ADS-1700W has kept the paperless container in an
OOM crash loop since 2026-09-21 10:21: ocrmypdf runs with 20 workers
(paperless default, cpu_count / TASK_WORKERS on a 20-core node) and blows
the 2Gi limit ~40s into OCR. The consume task is re-queued on every
restart, so the same file kills every attempt. 117 restarts so far, web
UI down as a side effect since worker and webserver share the container.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 21:24:36 +02:00
security-bot 4611ea3578 chore(image-automation): bump redis:8.10.2-alpine
ci/woodpecker/cron/alert-monitor Pipeline was successful
Updates managed by image-automation-controller.
2026-09-21 18:52:58 +00:00
2 changed files with 4 additions and 28 deletions
+3 -27
View File
@@ -27,24 +27,8 @@ data:
PAPERLESS_ALLOWED_HOSTS: "*"
PAPERLESS_TIME_ZONE: "Europe/Berlin"
PAPERLESS_OCR_LANGUAGE: "deu+eng"
# OCR concurrency, pinned rather than derived. paperless hands
# THREADS_PER_WORKER to ocrmypdf as its job count, and the default is
# cpu_count() / TASK_WORKERS. The container has no CPU limit, so
# multiprocessing.cpu_count() reports the NODE's cores — 20 on k8s-1 —
# and OCR fans out to "Starting processing with 20 workers concurrently".
# Twenty pages of a 300dpi colour scan rasterised at once blew past
# limits.memory below and the kernel OOMKilled the container (exit 137)
# mid-consume. Because celery re-picks the same document on every restart,
# that is a crash loop and not a one-off: the pod OOMs ~37s in, before the
# webserver ever finishes booting, so it never goes Ready and the archive
# stays down.
#
# TASK_WORKERS is already effectively 1 (20 cores / 1 worker = the 20 jobs
# observed); pinning it keeps that explicit so THREADS_PER_WORKER stays the
# only knob, and neither value silently changes when this lands on a node
# with a different core count.
PAPERLESS_TASK_WORKERS: "1"
PAPERLESS_THREADS_PER_WORKER: "4"
# Default is cpu_count / TASK_WORKERS, 20 on k8s-1; OCR memory scales with it.
PAPERLESS_THREADS_PER_WORKER: "5"
PAPERLESS_CONSUMER_RECURSIVE: "true"
PAPERLESS_CONSUMER_DELETE_DUPLICATES: "true"
PAPERLESS_CONSUMER_ENABLE_BARCODES: "true"
@@ -291,15 +275,7 @@ spec:
cpu: 200m
memory: 512Mi
limits:
# Headroom, not the fix — capping OCR jobs in paperless-config
# is. Sized from what a healthy pod actually uses: the last
# long-lived container held a steady ~1.0Gi working set, so 2Gi
# left barely 1Gi for an OCR burst. 3Gi keeps a 4-job burst
# clear of the ceiling. The crashlooping containers never showed
# this in cadvisor (~820Mi peak) because they lived 37s against
# a ~30s scrape interval — the spike fell between samples, so
# the OOMKilled status, not the metric, is the reliable signal.
memory: 3Gi
memory: 4Gi
securityContext:
runAsNonRoot: false
allowPrivilegeEscalation: true
+1 -1
View File
@@ -25,7 +25,7 @@ spec:
type: RuntimeDefault
containers:
- name: redis
image: redis:8.10.1-alpine # {"$imagepolicy": "flux-system:redis-paperless"}
image: redis:8.10.2-alpine # {"$imagepolicy": "flux-system:redis-paperless"}
args:
- redis-server
- --save