How would you organize load testing for the designed service: what baseline scenarios, signs of degradation, and Kubernetes container metrics should be monitored?
Asked at
AI answer
First, I’d define the target SLAs/SLOs and load profile: expected concurrent users, request frequency, proportion of uploads, file sizes, context length, and LLM provider behavior. Testing should be done in an environment close to production, with realistic data and controlled limits on external dependencies.
Scenarios:
- Baseline test: individual requests, document uploads, and processing.
- Load test: gradually ramp up to the expected peak and sustain the load.
- Spike test: briefly apply a load above the expected level to check limits and recovery.
- Soak test: sustain a steady load for hours to identify leaks and queue buildup.
- Failure test: introduce latency or unavailability in the LLM, vector database, queue, or pod; check timeouts, retries, and degraded behavior.
- Separately test different file and request sizes, as well as concurrent uploads and chats.
Signs of degradation: rising p95/p99 latency and error/timeout rates, reduced throughput, growing queues and document processing times, exhausted connections or provider quotas, frequent restarts and OOMKilled events, and reduced retrieval quality after retrieval configuration changes. For generation, it is useful to measure time to first token and total response time separately.
Kubernetes and container metrics: CPU usage and throttling, memory and OOM events, restarts and readiness/liveness failures, replica count and scaling speed, network traffic and errors, disk space and I/O. At the cluster level, monitor node health, pending pods, and resource shortages. Application metrics include RPS, latency percentiles, errors by type, active requests, queue lengths, processing time, tokens, and cost. Correlate metrics with traces and structured logs to locate the bottleneck, rather than merely detect overload.
Also asked at Т1 Иннотех
- What enables the OpenSearch engine to return results quickly across a huge database (what algorithm is it based on)?
- How would you build a system for evaluating the quality of a RAG pipeline and agents, including comparing versions when chunking changes and finding facts without using LLM-as-a-judge?
- How are Recall and Precision metrics calculated in the context of document retrieval?
- Design an architecture for an enterprise GPT (a chat with an LLM and document uploads for RAG) for 5,000 users per week.
- Give an example from your experience (resume) of a task similar to the asynchronous pipeline being designed.
Similar questions
- You’ve deployed a release. The service hasn’t gone down, but its response time has risen sharply (from 200 ms to 2 s). What would you do, and where would you look first?
- Which container state attributes in Docker Compose or Kubernetes should you monitor during a load test?
- A web service endpoint has started responding slowly. What steps would you take to identify and resolve the problem?
- DevOps case: A finished Python application has been deployed to Kubernetes in a banking environment. It started up but does not respond to requests. How would you diagnose the issue?
- How did you determine when a particular service needed to be scaled in Kubernetes?