L
Member
A Linux evaluation can show a failed or slow workload for reasons that are easy to conflate. One useful split is between kernel resource-pressure behavior and an application or model policy decision. Reclaim, thrashing, OOM events, cgroup limits, and I/O waits affect the process from below, while policy refusals are generated by application logic and usually return quickly with an application-level error rather than a resource-exhaustion signature.
Start by collecting evidence in separate layers. For memory pressure, capture psi output such as /proc/pressure/memory and /proc/pressure/io, per-cgroup memory.events for high, low, max, oom, and oom_kill counters, and system or cgroup OOM logs. Compare RSS, page-cache growth, swap-ins/swap-outs, and major faults around the failure window. If the workload is containerized, confirm whether the cgroup reached memory.max or memory.high before the reported failure; throttling under memory.high can look like application slowness even when no OOM kill occurs.
For policy refusals, look at the application’s request and response records, exit semantics, and timing. A policy path commonly produces a structured refusal, a distinct status or reason code, and little correlation with rising PSI stall percentages, major-fault spikes, or cgroup reclaim events. Run a controlled A/B comparison: keep the same kernel, cgroup limits, input size, and concurrency, then vary only the policy setting or prompt class. If only one class fails while memory pressure remains flat, the evidence points to policy. If both classes degrade as memory pressure rises, or failures track memory.max and OOM events, reclaim or containment is the more likely cause.
The key limitation is correlation alone: a policy call may happen to occur during reclaim. Preserve timestamps with one clock domain, record both cgroup counters and application traces, and reproduce the issue with pressure artificially below threshold. A clear diagnosis should state which layer contains the causal mechanism instead of labeling every slow or failed evaluation as either a model refusal or a Linux resource problem.
Start by collecting evidence in separate layers. For memory pressure, capture psi output such as /proc/pressure/memory and /proc/pressure/io, per-cgroup memory.events for high, low, max, oom, and oom_kill counters, and system or cgroup OOM logs. Compare RSS, page-cache growth, swap-ins/swap-outs, and major faults around the failure window. If the workload is containerized, confirm whether the cgroup reached memory.max or memory.high before the reported failure; throttling under memory.high can look like application slowness even when no OOM kill occurs.
For policy refusals, look at the application’s request and response records, exit semantics, and timing. A policy path commonly produces a structured refusal, a distinct status or reason code, and little correlation with rising PSI stall percentages, major-fault spikes, or cgroup reclaim events. Run a controlled A/B comparison: keep the same kernel, cgroup limits, input size, and concurrency, then vary only the policy setting or prompt class. If only one class fails while memory pressure remains flat, the evidence points to policy. If both classes degrade as memory pressure rises, or failures track memory.max and OOM events, reclaim or containment is the more likely cause.
The key limitation is correlation alone: a policy call may happen to occur during reclaim. Preserve timestamps with one clock domain, record both cgroup counters and application traces, and reproduce the issue with pressure artificially below threshold. A clear diagnosis should state which layer contains the causal mechanism instead of labeling every slow or failed evaluation as either a model refusal or a Linux resource problem.