Skip to content

Commit f865899

Browse files
authored
TIKA-4863 - omp thread limit (#3105)
1 parent 21e6a9e commit f865899

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Release 4.1.0 - unreleased
22

3+
* The tika-server full and tika-grpc Docker images set OMP_THREAD_LIMIT=1:
4+
the distro tesseract links OpenMP and runs up to 4 threads per OCR
5+
process, which oversubscribes the CPU under forked parse workers;
6+
single-threaded tesseract with process-level parallelism is the
7+
tesseract project's guidance for servers (TIKA-XXXX).
8+
39
* embedded-limits maxDepth counts embedding levels again instead of the
410
parsers a parse passes through; with AutoDetectParser over DefaultParser
511
every value above 1 used to stop one level early (TIKA-4857).

tika-grpc/docker-build/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ USER $UID_GID
5656

5757
EXPOSE 9090
5858
ENV TIKA_VERSION=$VERSION
59+
# tesseract links libgomp; one thread per OCR process - parallelism comes from the forked parse workers
60+
ENV OMP_THREAD_LIMIT=1
5961
ENV TIKA_GRPC_MAX_INBOUND_MESSAGE_SIZE=$TIKA_GRPC_MAX_INBOUND_MESSAGE_SIZE
6062
ENV TIKA_GRPC_MAX_OUTBOUND_MESSAGE_SIZE=$TIKA_GRPC_MAX_OUTBOUND_MESSAGE_SIZE
6163
ENV TIKA_GRPC_NUM_THREADS=$TIKA_GRPC_NUM_THREADS

tika-server/docker-build/full/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ RUN set -eux \
7373
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
7474
ARG TIKA_VERSION
7575
ENV TIKA_VERSION=$TIKA_VERSION
76+
# tesseract links libgomp; one thread per OCR process - parallelism comes from the forked parse workers
77+
ENV OMP_THREAD_LIMIT=1
7678

7779
COPY --from=fetch_tika /opt/tika-server /opt/tika-server
7880
# WORKDIR sets the CWD so tika-server's plugin-root fallback resolves

tika-server/docker-build/full/Dockerfile.snapshot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ RUN set -eux \
4444
&& apt-get clean -y \
4545
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4646
ENV TIKA_VERSION=$TIKA_VERSION
47+
# tesseract links libgomp; one thread per OCR process - parallelism comes from the forked parse workers
48+
ENV OMP_THREAD_LIMIT=1
4749
# Snapshot workflow tars the bin distribution into <context>/tika-server/, so
4850
# this COPY lands the thin jar + lib/ + plugins/ at /opt/tika-server/, matching
4951
# the release-variant Dockerfile.

0 commit comments

Comments
 (0)