← Back to libraryQuestion 193 of 273
🌐API TestingIntermediate

API Performance Testing - Latency and Throughput

📌 Definition:

Understanding key performance metrics that determine API quality - how fast it responds and how many requests it can handle.

📖 Detailed Explanation:

Performance has two dimensions: latency (individual request speed) and throughput (how many requests/second). Both matter - a fast API that can only handle 10 requests/second is insufficient for 1000 users. Understanding these concepts helps identify performance issues.

📎 Latency Definition:

Time from request start to response complete. Example: 245ms latency means took 245 milliseconds.

📎 Throughput Definition:

Number of requests per second (RPS) the API can handle. Example: 1000 RPS = 1000 requests per second.

📎 Key Concepts:
  • Latency affects individual users - how fast their request completes
  • Throughput affects system capacity - how many users can be served
  • As load increases, latency typically increases
  • SLA defines acceptable performance - e.g., 99th percentile < 500ms
  • JMeter is commonly used to measure performance
🎯 Scenario-Based Interview Question:

Scenario: Your video streaming API has these performance metrics: (1) Latency: p50=100ms (50% of requests), p99=500ms (99% of requests), (2) Throughput: Currently 2000 RPS, (3) User base: 50,000 concurrent users during peak hours, (4) SLA: 99% requests < 400ms, (5) Budget: Can add $5000 for infrastructure. Your manager says 'Latency seems fine, no action needed.' Do you agree? Why or why not? Provide a detailed analysis and recommendation.