Load Test vs Stress Test
1 min readSep 4, 2024
Load Testing
- Purpose: Load testing is used to evaluate the performance of a system under a specific, expected load. The goal is to see how the system behaves when it is subjected to a typical or expected number of concurrent users or transactions.
- Focus: Concurrency. Load testing checks how the system handles multiple users or requests at the same time (i.e., concurrent users). It measures response times, throughput, resource utilization, and other metrics under normal conditions.
- Example: Testing a web server with 1,000 concurrent users to ensure it can handle typical usage during peak times.
Stress Testing
- Purpose: Stress testing is used to determine the system’s behavior under extreme conditions, often beyond its normal operational capacity. The goal is to find the breaking point or to see how the system degrades when pushed to its limits.
- Focus: Both concurrency and parallelism, but with an emphasis on pushing the system beyond its expected limits. Stress testing might involve very high numbers of concurrent users (concurrency) and high CPU/memory usage (parallelism) to see how the system handles overloads.
- Example: Gradually increasing the number of users to 10,000 to see at what point the server crashes or response times become unacceptable.
Here is a simple echo server: https://github.com/drkrishnan8109/GoGo/blob/main/echoserver.go
and use the simple tool wrk to test it: wrk -t10 -c500 -d30s http://localhost:8080/