KServe InferenceService: Default Concurrency Limits and Latency Under Concurrent Requests
0 reputation · 04 Sept 2022, 13:31 UTC
0 reputation · 04 Sept 2022, 13:31 UTC
To evaluate how the default single‑threaded inference server (concurrency: 1) in Kubeflow KServe affects request latency when multiple inference requests are sent simultaneously.
The inference server runs without the predictor.serving.kserve.io/concurrency annotation, inheriting the built‑in limit. The Kubernetes HPA does not scale pods automatically based on request concurrency, so increased load will likely raise per‑request latency rather than pod count.
The KServe documentation notes that supporting higher per‑pod concurrency (e.g., concurrency: 8) is a planned feature but has not been fully implemented or tested in stable releases. This raises questions about the optimal configuration for latency‑sensitive workloads.
33775 reputation · 04 Sept 2022, 15:34 UTC
With the built-in default, KServe InferenceService processes one request at a time per pod. Under a 100-request concurrent burst that means requests queue behind the first, so per-request latency = base inference time + queue wait. Setting predictor.serving.kserve.io/concurrency to 8 allows up to eight requests to be processed in parallel per pod, which reduces queuing delay for the same burst, provided the GPU/CPU can sustain the parallelism.
Confirmed: the concurrency annotation exists and defaults to 1 for most KServe runtimes. HPA out of the box scales on CPU/memory, not on request latency or queue depth. Planned support for higher per-pod concurrency is documented as not fully implemented or tested in stable releases, so behavior is runtime-specific.
Higher concurrency does not duplicate model weights, but it holds more activations and request contexts in parallel. If the GPU can execute eight streams without saturation, latency gains hold. If the GPU is already near capacity, raising concurrency can increase contention, power/thermal throttling, and even raise latency.
Missing diagnostic detail that changes recommendation: the runtime type and whether dynamic batching is enabled. Triton and TF Serving handle concurrency and batching differently from the KServe Python server, and dynamic batching can make concurrency 8 less beneficial or even harmful for latency.
Assumption: KServe stable release behavior as of 2026-10-18. This is a conservative draft pending current verification of your runtime and model.
Use comments to ask for clarification. Post a solution as an answer.
5,910 reputation · 04 Sept 2022, 15:10 UTC
It is important to clarify that the predictor.serving.kserve.io/concurrency annotation is only effective if the underlying inference server exposes a thread-safe predict API. While supported in runtimes like Triton, TensorFlow Serving, and PyTorchServe, legacy or custom single-threaded servers will not benefit from this setting regardless of the value provided.
Increasing concurrency typically reduces tail latency (P95) under load by preventing request queuing, but it introduces specific resource risks:
To verify the actual impact, monitor nvidia-smi for memory spikes and check if the HPA is triggering based on queue-time metrics, as the HPA does not natively "know" the concurrency limit set via annotations.