[GH-ISSUE #11082] how to set OLLAMA_NUM_PARALLEL in Ollama docker container ? #69369

Closed
opened 2026-05-04 17:55:40 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @doyoungim999 on GitHub (Jun 16, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11082

What is the issue?

I want to limit CPU usage in ollama container.
How to add "OLLAMA_NUM_PARALLEL=4" in ollama docker container?

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @doyoungim999 on GitHub (Jun 16, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11082 ### What is the issue? I want to limit CPU usage in ollama container. How to add "OLLAMA_NUM_PARALLEL=4" in ollama docker container? ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the question label 2026-05-04 17:55:40 -05:00
Author
Owner

@rick-github commented on GitHub (Jun 16, 2025):

OLLAMA_NUM_PARALLEL doesn't really have anything to do with limiting CPU usage, but this is how to set it in docker compose:

services:
  ollama:
    image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest}
    environment:
      - OLLAMA_NUM_PARALLEL=4
    ports:
      - 11434:11434

Or via docker run:

docker run --rm --env OLLAMA_NUM_PARALLEL=4 -p 11434:11434 -d --name ollama ollama/ollama
<!-- gh-comment-id:2974804356 --> @rick-github commented on GitHub (Jun 16, 2025): `OLLAMA_NUM_PARALLEL` doesn't really have anything to do with limiting CPU usage, but this is how to set it in docker compose: ```yaml services: ollama: image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest} environment: - OLLAMA_NUM_PARALLEL=4 ports: - 11434:11434 ``` Or via docker run: ``` docker run --rm --env OLLAMA_NUM_PARALLEL=4 -p 11434:11434 -d --name ollama ollama/ollama ```
Author
Owner

@doyoungim999 commented on GitHub (Jun 16, 2025):

I am deploying on OpenShift with the following :
spec:
containers:
- name: ollama
image: ollama:latest
env:
- name: OLLAMA_NUM_PARALLEL
value: "4"

<!-- gh-comment-id:2974816631 --> @doyoungim999 commented on GitHub (Jun 16, 2025): I am deploying on OpenShift with the following : spec: containers: - name: ollama image: ollama:latest env: - name: OLLAMA_NUM_PARALLEL value: "4"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69369