|
| As enterprises adopt autonomous agentic AI pipelines, engineering teams face two important questions: can security be added without significantly affecting performance, and where should optimization efforts focus to improve the overall system?
Traditional inference benchmarks often measure a model in isolation. Production agentic applications involve a wider request path: an agentic harness assembles context, manages sessions, injects tool schemas, provisions secure execution environments when required, and communicates with the model-serving runtime. Each stage can contribute to latency and resource consumption.
This article explores a profiling methodology for a secured agentic pipeline running on Red Hat OpenShift AI. It summarizes how OpenTelemetry tracing, resource metrics, and client-side measurements can reveal the real performance characteristics of the agentic stack.
OVERVIEW
Why Profile the Complete Agentic Pipeline?
An agentic request does more than send a prompt to a model. Before and after inference, the framework may parse and route HTTP requests, expand prompts with system instructions and tool definitions, manage conversation context, initialize an isolated sandbox, classify model output, and forward streamed responses.
Measuring only model prefill and token generation can therefore hide important bottlenecks. Profiling the complete lifecycle helps teams understand:
- How much latency is introduced by the agent framework and sandbox layer.
- Which pipeline stages consume CPU and memory.
- Whether GPU capacity is being fully utilized.
- How concurrency changes response times and resource requirements.
- How to size worker nodes for the actual workload.
Benchmark Methodology
The benchmark compared progressively more complex configurations to isolate the overhead introduced by the agentic harness and the security sandbox.
OpenClaw
The agentic harness assembles the system prompt, tool schemas, and conversation history before forwarding the expanded request to vLLM.
|
|
OpenClaw + OpenShell
The secured pipeline adds OpenShell sandbox provisioning to support isolated code execution. The benchmark used per-session provisioning.
|
|
The experiment used three concurrency levels—1, 5, and 10 agents—across three stack configurations, producing nine benchmark runs. Each agent ran as an independent OpenClaw instance and was driven by a dedicated GuideLLM worker sending 500 prompts per dataset to the streaming Responses API endpoint. Tool calling was disabled to isolate single-turn framework overhead.
Profiling infrastructure
| Component |
Benchmark configuration |
| Platform |
Red Hat OpenShift AI |
| Cloud provider |
IBM Cloud |
| GPU nodes |
8 × NVIDIA A100-SXM4-80GB |
| Worker nodes |
1 × cx4-24×48 |
| Model |
Qwen3-8B-FP8-dynamic |
| Agent harness |
OpenClaw |
| Sandbox |
OpenShell, with sandbox mode set to all and per-session provisioning |
| Datasets |
HumanEval for coding tasks and GSM8K for mathematical reasoning |
| Load pattern |
500 prompts per dataset per worker; sequential requests; streaming response |
Observability and measurement
OpenTelemetry traces were used to capture internal stage timings. Infrastructure measurements included per-pod CPU and memory, GPU tensor-core activity, HBM bandwidth, KV cache usage, and request queue depth. GuideLLM captured client-observed time to first token (TTFT) and end-to-end (E2E) latency.
Measurement
area |
Metrics |
Collection source |
Agent internal
latency |
HTTP parsing and routing, sandbox provisioning, context assembly, vLLM prefill, response processing |
OpenTelemetry tracing |
| Resource utilization |
Pod CPU and memory, GPU activity, HBM bandwidth, KV cache, queue depth |
Prometheus, cgroup, DCGM |
Client-observed
latency |
TTFT and E2E latency (P50, P95, and mean) |
GuideLLM |
Understanding the Pipeline Latency
The request lifecycle was divided into measurable stages so that the team could identify where time was spent. In the agent-harness-only configuration, response processing became a major contributor as concurrency increased.
| Pipeline metric (ms) |
C – 1 |
C – 5 |
C – 10 |
| HTTP parse plus routing |
160 |
252 |
316 |
| Context assembly |
123 |
245 |
257 |
| vLLM prefill |
40 |
59 |
62 |
| TTFT (agent) |
322 |
556 |
635 |
| Response processing |
498 |
1,408 |
2,437 |
| TTFT (client) |
820 |
1,964 |
3,072 |
| Token generation (512 tokens) |
4,470 |
6,622 |
8,289 |
| E2E (client) |
5,290 |
8,586 |
11,361 |
Response processing increased from 498 ms at one concurrent agent to 2,437 ms at ten concurrent agents. This stage includes work such as token classification, tool detection, and stream forwarding. The measurements indicate that framework-side processing can become a significant performance constraint even when model inference remains relatively short.
Adding the OpenShell security layer
With OpenShell enabled, the benchmark measured sandbox initialization as an additional pipeline stage. At concurrency level one, the secured configuration recorded 5,814 ms E2E latency, compared with 5,290 ms for the agent-harness-only configuration. Sandbox initialization accounted for 140 ms of the secured run; response processing and context assembly also differed between the configurations.
| Secured pipeline metric (ms) |
C – 1 |
C – 5 |
C – 10 |
| HTTP parse plus routing |
37 |
164 |
458 |
| Sandbox initialization |
140 |
521 |
551 |
| Context assembly |
219 |
361 |
342 |
| vLLM prefill |
41 |
68 |
65 |
| TTFT (agent) |
437 |
593 |
865 |
| Response processing |
895 |
2,537 |
1,610 |
| TTFT (client) |
1,332 |
3,130 |
2,475 |
| Token generation (512 tokens) |
4,481 |
7,286 |
8,971 |
| E2E (client) |
5,814 |
10,416 |
11,446 |
These figures should be interpreted as results from the specific benchmark setup, not as universal performance guarantees. They show why teams should measure each stage in their own environment and workload.
CPU, Memory, and GPU Utilization
Agentic workloads include substantial work outside the GPU. OpenClaw instances assemble context, classify tokens, and forward streams, so CPU and memory planning must account for the agent layer as well as model-serving requirements. |
1.8 cores
Average CPU for one agent pod at C = 1
|
|
13.9 cores
Average combined CPU across ten agent pods at C = 10
|
|
6.03 GiB
Average combined memory across ten agent pods at C = 10
|
|
At C = 10, the ten OpenClaw pods used 18.6 CPU cores at P95 and 7.25 GiB of memory at P95. Against a 24-vCPU worker, that represents approximately 80% of the node’s CPU capacity at P95 for this single-turn baseline.
GPU utilization findings
At ten concurrent agents, tensor-core activity reached 35%, KV cache occupancy was 14%, and the vLLM request queue was empty 67% of the time, with an average queue depth of one request. Memory-copy utilization and HBM bandwidth remained relatively flat across the tested concurrency levels.
In this benchmark, the GPU was not fully saturated. This suggests that the agent framework and request orchestration can limit throughput before additional GPU capacity becomes necessary. The conclusion may differ with other models, request lengths, tool usage, and traffic patterns.
The Impact of Prompt Expansion
An agentic harness can expand a short user prompt by injecting system instructions, tool schemas, and conversation context. In the benchmark, an approximately 83-token original prompt became several thousand input tokens after expansion.
| Scenario |
Original
prompt |
Input
tokens |
Output
tokens |
Total
tokens |
Overhead
ratio |
| Agent harness |
~83 |
7,867 |
512 |
8,379 |
16.4× |
Secured agent with
OpenShell |
~83 |
8,135 |
512 |
8,647 |
16.9× |
Prompt expansion affects input-token consumption and can increase inference cost in token-priced environments. In self-hosted deployments, the expanded context also increases the processing work performed by the agent framework and can constrain throughput.
OpenShell Sandbox Provisioning and Performance
Sandbox initialization time depends on whether the required pod is already available. The benchmark distinguishes between a cold start and a warm start, and also measures reuse of an existing session sandbox.
Cold start
No sandbox pod is available. The system must build and schedule the pod, pull its image, and register the supervisor.
|
|
Warm start
The OpenShell pod is already running, but a new sandbox session must be initialized through authentication, configuration exchange, and connection setup.
|
|
Sandbox usage scopes
- Session scope: Initialize once per session and reuse the sandbox for subsequent tool calls in that conversation.
- Turn scope: Initialize for every tool call. This provides stronger separation between actions but incurs the highest repeated initialization cost.
- Agent scope: Initialize once for the agent’s lifetime. This reduces repeated setup for trusted or stateless workloads where cross-conversation isolation is not required.
| Sandbox operation |
P50 |
P95 |
Mean |
| Cold start |
16.4 s |
28.9 s |
19.3 s |
| Warm start |
247 ms |
295 ms |
251 ms |
| Session reuse |
134 ms |
175 ms |
144 ms |
With warm pools enabled, the reported warm-start readiness remained below 300 ms in this test. Session reuse reduced the measured operation time further. The results demonstrate that sandbox lifecycle and reuse strategy are important inputs to both security design and performance planning.
Capacity Planning and Deployment Sizing
The benchmark provides indicative minimum node sizing for the tested secured-agent fleet. These figures are tied to the reported configuration and should be validated against the intended model, concurrency, prompt size, tool usage, and service-level objectives.
Number of secured
agents |
Minimum node
CPU |
Minimum node
memory |
Benchmark note |
| 1–3 |
8 vCPU |
8 GiB |
Fits comfortably on a single worker |
| 5 |
16 vCPU |
8 GiB |
Approximately 60% node utilization at P95 |
| 10 |
24 vCPU |
16 GiB |
Approximately 80% node utilization at P95 |
For production planning, teams should leave operational headroom for workload bursts, platform services, monitoring agents, pod scheduling, and changes in request complexity. The published benchmark is a single-turn baseline; multiturn interactions and tool execution can require additional resources.
Practical Recommendations
|
|
Benchmark the complete request lifecycle
Measure routing, context assembly, sandbox initialization, model prefill, response processing, and client-observed latency. Avoid relying only on isolated model benchmarks.
|
|
|
|
Use distributed tracing to locate bottlenecks
Instrument pipeline stages with OpenTelemetry and correlate trace spans with CPU, memory, and GPU metrics. This helps distinguish framework overhead from inference time.
|
|
|
|
Include the agent layer in capacity estimates
Size worker nodes for context assembly, response processing, and stream forwarding—not only for model-serving GPUs.
|
|
|
|
Choose sandbox scope based on risk and workload
Evaluate session, turn, and agent scopes according to the required isolation boundary. Reuse can reduce repeated setup, but should not weaken the security guarantees required by the application.
|
|
|
|
Test with representative traffic
Extend single-turn baselines with realistic multi-turn conversations, tool invocations, code execution, variable request rates, and mixed sandbox lifecycles before finalizing production sizing.
|
Testing and Validation Checklist
| ✓ |
Capture end-to-end traces for representative agent requests. |
| ✓ |
Measure P50, P95, and mean latency for key pipeline stages. |
| ✓ |
Monitor CPU and memory usage for every agent and sandbox pod. |
| ✓ |
Track GPU tensor-core activity, KV cache occupancy, HBM bandwidth, and serving queue depth. |
| ✓ |
Compare sandbox cold-start, warm-start, and reuse behavior. |
| ✓ |
Test at the expected concurrency levels and include peak-load scenarios. |
| ✓ |
Validate that the selected sandbox scope meets the application’s isolation requirements. |
| ✓ |
Repeat sizing tests with multi-turn and tool-calling workloads before production rollout. |
|
BRINGING IT TOGETHER
Conclusion
Profiling a secured agentic pipeline on Red Hat OpenShift AI requires visibility across the complete request path. The benchmark illustrates that orchestration tasks—including context assembly, routing, response processing, and stream delivery—can account for a substantial share of latency and resource consumption.
It also shows that sandbox isolation can be introduced with a relatively small measured footprint in the tested environment. Rather than treating security and performance as opposing goals, engineering teams can use tracing and workload-specific benchmarking to select appropriate isolation scopes, identify bottlenecks, and right-size their clusters.
The key takeaway is straightforward: optimize the complete agentic system, not just the model. A measured understanding of the harness, sandbox, CPU, memory, and GPU layers provides a stronger foundation for reliable enterprise AI deployments.
|
|