In brief
A cloud load test generates traffic from machines in a cloud provider's regions rather than from the company network. It pays off when the system serves customers over the internet, traffic should pass through the CDN and WAF like real traffic, and local generators cannot reach the required scale. The bill is not just generator hours: outbound data transfer from the system under test, log ingestion and CDN request fees are often larger. The test also has to be agreed with providers, because heavy traffic from a few sources looks like an attack.
When to generate load from the cloud and when from your own network
Cloud load generators are not better in themselves. They fit some systems and not others.
| Situation | Cloud generators | Generators in your own network |
|---|---|---|
| Online store, internet banking, customer-facing app | yes, traffic takes the same route as customers | only for backend-only tests |
| Internal system reachable over VPN | difficult, access has to be opened | yes |
| Very high traffic, many thousands of requests per second | yes, machines are easy to add | limited by bandwidth and hardware |
| Testing CDN, WAF, cross-region load balancing | yes | no, traffic bypasses those layers |
| Data that must not leave the company | with care, no personal data in scripts | yes |
Many tools combine both models. Grafana Cloud k6 has public load zones in cloud regions and private load zones running in your own network. Azure Load Testing and the Distributed Load Testing on AWS solution run generators in the provider's cloud. Choosing a tool is covered in Commercial or open source performance testing tools.
Traffic from several regions: why and how to split it
Traffic from several regions makes sense when customers are in several countries or the system runs in several cloud regions. A test from a single region checks capacity but does not show what a customer at the other end of Europe sees: a longer network path, a different CDN node, different load balancing behavior.
The traffic split comes from analytics, not intuition. If 70% of sessions come from Poland, 20% from Germany and 10% from the UK, the test splits traffic the same way. In k6 cloud tests this is done with a distribution across load zones with percentages that must add up to 100.
Three things are worth checking in a multi-region test:
- Response times per region, not combined. An average across regions hides a problem in one of them.
- CDN cache hits in each region. A CDN node that sees a page for the first time sends the request to the origin server.
- Traffic routing when a region fails. When one region of the system is down, traffic moves to the other. The test shows whether the other region can take it.
Where cloud regions are in Poland and what that means for data is covered in Cloud in Poland: regions and data.
What the test bill is made of
The bill for a cloud load test has several items, and the generators themselves are rarely the largest.
| Item | What it depends on | Who pays |
|---|---|---|
| Load generators | number and type of machines, test time including warm-up | the test account or the tool subscription |
| Outbound transfer from the system under test | response size times number of requests | the account of the system under test, if it runs in the cloud |
| CDN and WAF | number of requests and data transferred | the account of the system under test |
| Autoscaling of the system under test | extra instances during the test | the account of the system under test |
| Logs and monitoring | entries per request, ingestion fees | the account of the system under test |
| Paid external services | API calls, text messages, emails, if the test does not bypass them | the account of the system under test |
An example to reason with: the test runs for two hours at 1,000 requests per second, and the average response is 200 KB. That is 200 MB per second, roughly 720 GB per hour and about 1.4 TB over the whole test. If the system under test runs in the cloud and the generators are outside its region, that transfer appears on the bill as outbound data. Calculate the cost from your provider's data transfer price list. Logs work the same way: an application that writes several entries per request will produce millions of entries in such a test.
Ways to cut the cost: generators in the same region as the system when the test is not about the network; short runs for tuning and full scale only for the decisive runs; temporarily lower log levels if the test is not about logging; stubs for paid APIs. Cloud cost metrics are covered in FinOps.
Agreements with providers and security
Heavy traffic from a few addresses looks like an attack to protection systems. Before the test, agree on several things:
- The cloud provider's policy. For example, the Amazon EC2 testing policy prohibits volumetric DDoS simulations, asks that the traffic source be in the same region as the target within AWS and reserves the right to shape traffic above a certain threshold. Other providers have their own rules.
- CDN and WAF. Add the generator addresses to exceptions or tag test traffic with a header, so protection rules do not block the test halfway. Run some tests without exceptions to check that protection works.
- Security team and SOC. Share the test window, source addresses and a contact person, so nobody starts the incident procedure.
- External providers. The payment gateway, text message provider or API partner should know about the test or be replaced with a stub.
- A stop button. One person who can stop the test immediately, with agreed thresholds for doing so.
At B2Bnetwork, cloud-based performance testing is planned together with the bill and the agreements before the generators start. An example of preparing a store where traffic passes through a CDN is the case study Preparing an online store for Black Friday. What in the environment itself has to match production is covered in The performance testing environment.
Questions and answers
Is a cloud load test more expensive than one from your own machines?
The cloud generators themselves are usually cheap because they run for a few hours. The cost grows on the side of the system under test: outbound transfer, CDN, logs and autoscaling. So before the test, calculate the volume of data and log entries, and run at full scale only in the passes that really need it.
Do I need to notify the cloud provider about a load test?
It depends on the provider and the type of test. Read your provider's current testing policy before planning. Regardless of it, notify your CDN, WAF and external service providers and your own security team, because they will see the traffic and may block it.
How many regions does the test need?
As many as matter for customers or the architecture. For a store selling in Poland, one region close to customers and a capacity test are usually enough. For a system in several countries or several cloud regions, reproduce the traffic split from analytics and test the failure of one region.
Can cloud generators test an internal system?
They can, but it requires opening access from the cloud to the company network, which is usually harder than testing from your own network. The answer is private generators running in your own infrastructure and controlled from the same tool. Traffic then never leaves the company network.