This is an automated email from the ASF dual-hosted git repository.
tballison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/main by this push:
new f865899ba8 TIKA-4863 - omp thread limit (#3105)
f865899ba8 is described below
commit f865899ba85dbbd808f72bb925154b71f51858e5
Author: Tim Allison <[email protected]>
AuthorDate: Mon Aug 31 09:44:04 2026 -0400
TIKA-4863 - omp thread limit (#3105)
---
CHANGES.txt | 6 ++++++
tika-grpc/docker-build/Dockerfile | 2 ++
tika-server/docker-build/full/Dockerfile | 2 ++
tika-server/docker-build/full/Dockerfile.snapshot | 2 ++
4 files changed, 12 insertions(+)
diff --git a/CHANGES.txt b/CHANGES.txt
index ce09fe0392..cfc2c66ea6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,11 @@
Release 4.1.0 - unreleased
+ * The tika-server full and tika-grpc Docker images set OMP_THREAD_LIMIT=1:
+ the distro tesseract links OpenMP and runs up to 4 threads per OCR
+ process, which oversubscribes the CPU under forked parse workers;
+ single-threaded tesseract with process-level parallelism is the
+ tesseract project's guidance for servers (TIKA-XXXX).
+
* embedded-limits maxDepth counts embedding levels again instead of the
parsers a parse passes through; with AutoDetectParser over DefaultParser
every value above 1 used to stop one level early (TIKA-4857).
diff --git a/tika-grpc/docker-build/Dockerfile
b/tika-grpc/docker-build/Dockerfile
index 1a19270261..73e2a5986d 100644
--- a/tika-grpc/docker-build/Dockerfile
+++ b/tika-grpc/docker-build/Dockerfile
@@ -56,6 +56,8 @@ USER $UID_GID
EXPOSE 9090
ENV TIKA_VERSION=$VERSION
+# tesseract links libgomp; one thread per OCR process - parallelism comes from
the forked parse workers
+ENV OMP_THREAD_LIMIT=1
ENV TIKA_GRPC_MAX_INBOUND_MESSAGE_SIZE=$TIKA_GRPC_MAX_INBOUND_MESSAGE_SIZE
ENV TIKA_GRPC_MAX_OUTBOUND_MESSAGE_SIZE=$TIKA_GRPC_MAX_OUTBOUND_MESSAGE_SIZE
ENV TIKA_GRPC_NUM_THREADS=$TIKA_GRPC_NUM_THREADS
diff --git a/tika-server/docker-build/full/Dockerfile
b/tika-server/docker-build/full/Dockerfile
index 722b22aab2..15f9f276ed 100644
--- a/tika-server/docker-build/full/Dockerfile
+++ b/tika-server/docker-build/full/Dockerfile
@@ -73,6 +73,8 @@ RUN set -eux \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ARG TIKA_VERSION
ENV TIKA_VERSION=$TIKA_VERSION
+# tesseract links libgomp; one thread per OCR process - parallelism comes from
the forked parse workers
+ENV OMP_THREAD_LIMIT=1
COPY --from=fetch_tika /opt/tika-server /opt/tika-server
# WORKDIR sets the CWD so tika-server's plugin-root fallback resolves
diff --git a/tika-server/docker-build/full/Dockerfile.snapshot
b/tika-server/docker-build/full/Dockerfile.snapshot
index 5dc5dd253a..0df341cd30 100644
--- a/tika-server/docker-build/full/Dockerfile.snapshot
+++ b/tika-server/docker-build/full/Dockerfile.snapshot
@@ -44,6 +44,8 @@ RUN set -eux \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV TIKA_VERSION=$TIKA_VERSION
+# tesseract links libgomp; one thread per OCR process - parallelism comes from
the forked parse workers
+ENV OMP_THREAD_LIMIT=1
# Snapshot workflow tars the bin distribution into <context>/tika-server/, so
# this COPY lands the thin jar + lib/ + plugins/ at /opt/tika-server/, matching
# the release-variant Dockerfile.