CLOUD CONCEPT

Load Testing

Load testing evaluates how a system performs under a defined workload to verify capacity, response times, reliability, and scaling behavior.

Cloud Concepts Hub →

What is Load Testing

Load testing applies representative traffic or work to an application and measures whether it meets business performance requirements. In cloud environments, it helps engineers identify bottlenecks, validate automatic scaling, and prevent performance regressions through repeatable CI/CD tests.

Load testing measures application behavior under a specified workload, such as concurrent checkout sessions, API requests per second, or messages arriving at a queue. Its purpose is not simply to generate large amounts of traffic, but to determine whether the system meets measurable business requirements. For example, an ordering service might need to sustain 2,000 requests per second with a 99th-percentile response time below 500 milliseconds and an error rate below 0.1 percent.

Start by defining a realistic workload model. Include the production mix of operations, request sizes, authentication flows, data distributions, cache behavior, and user think time. Concurrent users and requests per second are not interchangeable: slower responses can reduce the request rate generated by a fixed population of simulated users. When evaluating an arrival-rate requirement, use a tool configuration that maintains the intended arrival rate and reports when generators cannot keep up. Otherwise, an overloaded application can appear healthier because the test unintentionally reduces demand.

Run tests against an isolated, production-like environment with comparable topology, scaling policies, quotas, and dependency behavior. Distributed load generators can simulate larger workloads, but their own CPU, network bandwidth, and connection limits must be monitored. Use controlled test data, protect credentials, and avoid sending unintended transactions to payment, email, or other external systems. Replacing dependencies with stubs can reduce cost and risk, but it also limits conclusions about end-to-end performance.

Collect client-side latency percentiles, throughput, timeouts, and errors alongside server-side metrics, logs, and traces. Average latency alone can hide severe delays affecting a small but important fraction of requests. Correlate application measurements with CPU utilization, memory pressure, database connections, lock waits, storage latency, queue age, throttling, and service quotas. High CPU may justify additional compute capacity, whereas database contention or an exhausted connection pool may require query optimization, connection management, caching, or architectural changes.

To validate scaling, increase demand gradually and observe the complete sequence from metric detection through capacity provisioning, application startup, health checks, and useful request handling. A checkout tier might scale out correctly while requests still fail because its database connection limit is reached. Adding more application instances can worsen that bottleneck. Other remediations include selecting a better scaling signal, adjusting instance warmup, increasing minimum capacity, using scheduled scaling for predictable peaks, or requesting quota increases. Repeat the same test after remediation to verify the improvement and its cost.

Distinguish related performance tests. Load testing validates behavior under defined expected demand; stress testing pushes beyond expected capacity to discover failure limits and recovery behavior. Spike testing examines abrupt changes, while soak testing exposes problems that emerge over extended operation. Benchmarking compares measurements across controlled configurations or software versions. These techniques complement one another rather than serving as interchangeable labels.

Integrate versioned test scripts into CI/CD after deploying the candidate application. Run short performance checks frequently, with larger distributed or endurance tests on a schedule or before important releases. Define automated pass/fail gates using explicit thresholds and retain results with the application version, infrastructure configuration, dataset, and test settings. Compare equivalent runs and account for environmental variability before declaring a regression. Stop unsafe tests automatically, clean up temporary resources, and budget for compute, requests, data transfer, and observability charges. Passing a load test demonstrates performance under the tested conditions, not unlimited scalability or correctness under every failure scenario.

Key aspects of Load Testing

Effective load testing combines realistic workloads, explicit success criteria, end-to-end observability, scaling validation, and repeatable execution within safe operational limits.

Representative workload modeling

Model realistic transaction mixes, arrival rates, payloads, data distributions, and user behavior. Confirm that the load generators actually deliver the intended workload rather than becoming the limiting factor.

Measurable performance criteria

Define acceptable throughput, latency percentiles, error rates, and recovery times before testing. Evaluate these together so that fast error responses or reduced request volume do not produce a misleading pass.

Bottleneck identification and remediation

Correlate client results with infrastructure metrics, application traces, and dependency behavior. Address the limiting resource or contention point, then rerun the same workload to validate the change.

Scaling behavior validation

Measure how quickly additional capacity becomes usable and whether it maintains service objectives during demand changes. Check scaling signals, warmup, health checks, quotas, and downstream limits rather than assuming additional instances solve every issue.

Repeatable pipeline integration

Version test scripts and execute them against controlled deployments through CI/CD. Use automated thresholds to block regressions and retain enough configuration metadata to compare results meaningfully.

Controlled scope and operational safety

Set test duration, maximum traffic, spending limits, and abort conditions. Isolate test data and external side effects, and distinguish expected-load validation from deliberate overload or long-duration testing.

Cloud services for Load Testing

AWS CodePipeline can deploy a candidate application and invoke AWS CodeBuild to run performance checks. For larger workloads, test automation can launch coordinated load-generator tasks on Amazon ECS and aggregate their results. Amazon CloudWatch supplies metrics and logs to correlate client-observed failures with resource constraints and scaling activity. If the application uses Amazon EC2 Auto Scaling, tests should verify both capacity growth and the delay before new instances serve traffic successfully. Amazon S3 retains datasets and result artifacts for repeatable comparisons. Together, these services support automated performance gates, but workload design, pass/fail logic, worker coordination, and safety controls remain responsibilities of the test implementation.

AWS CodeBuild image AWS CodeBuild

Runs scripted performance tests and threshold checks as build actions, using tools supplied in the build environment or a custom container image. A test script can return a nonzero exit code when performance criteria fail, preventing the pipeline from proceeding.

Open AWS CodeBuild →
Amazon CloudWatch image Amazon CloudWatch

Collects application and infrastructure metrics and logs used to correlate latency or errors with resource saturation and scaling events. Custom metrics can capture test-specific measurements, while alarms can support test abort conditions through automation.

Open Amazon CloudWatch →
AWS CodePipeline image AWS CodePipeline

Orchestrates deployment and performance-test actions within a release workflow. A failed test action can stop progression, while approval actions can provide additional control for expensive or production-impacting tests.

Open AWS CodePipeline →
Amazon EC2 Auto Scaling image Amazon EC2 Auto Scaling

Adjusts an EC2 fleet's capacity in response to configured scaling policies. Load tests verify whether policy thresholds, instance warmup, minimum capacity, and maximum capacity maintain application performance as demand changes.

Open Amazon EC2 Auto Scaling →
Amazon Simple Storage Service image Amazon S3

Stores test datasets, raw results, and comparison reports for later analysis. Associate artifacts with application revisions and test configurations, and apply access controls and lifecycle policies to manage sensitive data and retention costs.

Open Amazon S3 →