Repository navigation
Labels
effort/lowEffort Low: little workpriority/p2-mediumPriority P2: standard workscope/k8sKubernetes commands, Helm charts, pods, services, and policiessource/agentFiled by an agenttype/infraType infra: the build, CI, images or clustervalue/mediumValue Medium
Description
Problem
Each embedding-only instance uses 12 CPU cores under load, and the work runs on its GPU. llama-server starts with its default thread count, and its threads spin. On a node with two instances, that is 24 busy cores, against a request of 2 CPUs each.
Expected
An embedding-only tier sets LLAMA_ARG_THREADS: "1", so it uses about 1 core with no loss of speed.
Acceptance criteria
devops ai gateway renderwritesLLAMA_ARG_THREADS: "1"for a tier at or belowembedding_only, and a test holds it.- A tier newer than the threshold keeps its default thread count.
- The documents and the gateway comment give the measured numbers, and say why embeddings keep
simple-shuffle.
Evidence
Measured on ollama/ollama:0.40.12 with one Quadro P6000, with a batch of 32 chunks of about 300 tokens, and CPU from the cgroup cpu.stat:
num_thread |
Median | CPU core-seconds per batch | Mean cores |
|---|---|---|---|
| default | 1.69 s | 20.7 | 12.2 |
| 1 | 1.70 s | 2.0 | 1.2 |
| 2 | 1.70 s | 2.8 | 1.7 |
| 4 | 1.69 s | 4.5 | 2.6 |
| 8 | 1.69 s | 7.8 | 4.6 |
| 16 | 1.70 s | 14.2 | 8.4 |
LLAMA_ARG_THREADS=1in a temporary pod gave 1.69 s, 2.0 core-seconds and 1.2 cores.- Vectors with
num_thread1 and the default were exactly equal. - The
num_threadrequest option reloads the model (4.3 s) when a caller sends another value, so the environment variable is the better place.
Existing tool considered
The llama-server environment variable LLAMA_ARG_THREADS, as ollama-64gib already sets LLAMA_ARG_CACHE_RAM.
Related
Related: #3501
Metadata
Metadata
Assignees
Labels
effort/lowEffort Low: little workpriority/p2-mediumPriority P2: standard workscope/k8sKubernetes commands, Helm charts, pods, services, and policiessource/agentFiled by an agenttype/infraType infra: the build, CI, images or clustervalue/mediumValue Medium
Activity
dan-petty commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
perfprefix of the title gives the type.(k8s)scope of the title gives the scope.Saves 10 CPU cores per instance with no speed loss, but does not fix a failure or security issue.Reduces wasted CPU cores on shared nodes without affecting embedding latency or correctness.Set one environment variable in the render function, add a test, and update documentation.#3501 creates the embedding-only tier categories; this candidate sets a CPU thread limit on those tiers, a different configuration change on the same area.chore(main): release 0.56.1 (#3524)
devops-cli-service commentedon Nov 4, 2026
Released in v0.56.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.56.1
devops-cli-service commentedon Nov 4, 2026
Live since 2026-11-04 21:54 UTC