Índice do artigofaltam 16 min de leitura
How many people can your system handle at the same time?
The question comes up in the meeting before the campaign, the launch or the signing with the big client, and, without a load test, the answer is a guess. "It handles it easily." "It's in the cloud, it scales by itself." "We tested it and it was fast." None of those answers is a number, and to have that number before peak day, you have to measure.
Load testing is not the testing your team already does before every delivery. That one checks whether the system works: someone signs up, buys, issues the invoice, and everything goes fine. Load testing checks whether it keeps working when thousands of people do that in the same minute, how long each one waits for a response and what breaks first when volume goes past the limit. A system can pass every test of the first kind and go down when volume rises. We have seen it happen: a portal with good response times in the team's tests went down, overloaded, on an afternoon of client acceptance testing.
At X-Apps, we use k6 for load testing. It is an open source tool maintained by Grafana Labs.
Peak day has a date on the calendar
Google's SRE (site reliability engineering) book points to overload as the most common cause of cascading failures: one server goes down, its load moves to the remaining ones, those get closer to the limit and go down too, in a domino effect that takes down the whole service.
And many peaks have a date on the calendar:
- the highest-volume day for Pix (Brazil's instant payment system) in 2025 was December 5, with 313.34 million transactions, according to the annual report of the Banco Central (Brazil's central bank), which attributes December's above-average activity to the 13th-month salary (Brazil's mandatory year-end bonus) and the holidays. According to the calendar, December 5 was also the fifth business day of the month, the legal deadline for paying salaries, and the second-busiest day of the year, November 28, was Black Friday itself;
- on Black Friday 2025, Brazilian e-commerce generated R$ 4.76 billion (Brazilian reais) in sales and received 8.69 million orders in a single day, according to Neotrust, a Brazilian e-commerce data company;
- for the 2026 income tax filing, about 13.7 million returns, almost a third of the total, arrived in the last six days before the deadline (our calculation based on figures from the Receita Federal, Brazil's tax authority, published by Agência Brasil, the government news agency);
- TV campaigns, influencer posts and product launches have a time set by the company itself.
When volume is not predicted, it can make the news. The Banco Central opened the Sistema Valores a Receber (a service for citizens to check forgotten money in financial institutions) on January 24, 2022. That same night the tool became unstable and, the following afternoon, it went offline: according to Agência Brasil, unexpected demand brought down the central bank's own website. The service only reopened on the night of February 13, on a dedicated site, separated from the rest precisely so that the volume would not put the main site at risk again.
A known date gives the test a deadline: you can measure weeks ahead, fix the bottleneck and reach the day with the number in hand, instead of discovering it along with the client.
Where the limit shows up in your company
- Campaigns and launchesThe media is already paid for. If the site freezes at the minute of the ad, the campaign pays for the outage.
- Seasonal dates and deadlinesBlack Friday, enrollment, tax filing: volume shoots up on a few days of the year.
- PaydayIn 2025, Pix's highest-volume day coincided with the legal salary deadline.
- Integration with ERP and partnersEven if your system holds up, the one on the other side may have a per-second quota.
- A new client that doubles the base"Can the system handle it?" stops being a guess before signing.
- Infrastructure migrationThe same script before and after: the old environment only goes away when the new one hits the same numbers.
- A system that gets worse over the hoursMemory, connections and disk that run out little by little only show up after heavy use.
- Regulated industriesIn Brazil's Open Finance, the Banco Central itself sets minimum capacity and response time.
- AI in productionThe model provider may limit requests per minute, and a small pilot may never reach that limit.
Black Friday and ticket sales are the headline cases. Integration, growth and wear over the course of the day make fewer headlines and can show up in any company that runs its own system.
Integration is deceptive because the bottleneck may be outside your system. Bling (a popular Brazilian ERP), for example, documents a limit of 3 requests per second per account, across all modules combined (a request is each call one system makes to another); past that, the next ones are not processed. During an order peak, if the integration was not designed for that limit, the store accepts the purchase and it is the sync with the ERP that falls behind: outdated inventory, late invoices, and no visible error for the buyer. When the call to the ERP sits in the middle of the user's path, the effect shows up on screen: in one of our projects, a portal's login stopped working because the client's ERP API (the door through which one system talks to another), called at login time, took too long to respond.
With AI, the limit also lives with the vendor. Anthropic, for example, measures API limits in requests and tokens per minute (tokens are the pieces of text the model reads and writes), and warns in its documentation that short bursts can already exceed the limit. An assistant that responded well in a small pilot may start returning errors when the whole company starts using it at the same time.
In both cases, the limit is in the vendor's documentation. A load test, run against a simulator that respects that limit, shows what your system does when it hits it, before the peak, while there is still time to design queues, batch sends and retries with backoff.
Load, stress and spike testing: what is the difference
All of them simulate users following a script, the sequence of steps of a real person (search, add to cart, pay), and measure the system. What changes is the shape of the load and the question each one answers. The k6 documentation describes six types:
| Test and load shape | Question it answers |
|---|---|
| Smoke | Does the script work and does the system respond well under minimal use? It runs in minutes, on every code change. |
| Average load | Does the system handle a normal day within the agreed time? |
| Stress | And on the busiest day you expect: deadline, payday, peak hour, end of the week? |
| Spike | Does it survive the minute of the TV ad or the opening of sales, when everyone arrives at once? |
| Soak | Does it stay the same at the end of the day, or does it get worse over the hours? |
| Breakpoint | Where is the limit, and what breaks first? |
Source: Grafana k6 documentation, test types guide, read on October 2, 2026. The dashed line marks a normal day's load.
The difference between load testing and stress testing comes down to the question. The average load test answers for a normal day. The stress test, for the busiest day you expect. The breakpoint test, for where the limit is and what breaks first.
Order matters. The k6 documentation says to start with smoke and only then increase load and duration, and it gives a warning that applies to anyone testing for the first time: the system may be less solid than it seems, and thousands of the tool's users have quickly brought down their own application, or the staging environment (the copy of the system used for testing), in a load test.
The soak test looks for what only shows up over time: response time that gradually gets worse, memory that leaks, storage that runs out. In the systems we operate, we have seen an API go down because of a full disk, an exhaustion that builds up with use and that a short test finishes before it can show. For anyone running a system that cannot stop, it is the test that finds the leak before a scheduled restart becomes routine.
No single type covers everything, and the documentation itself says so. The combination depends on where your system's risk is, and that is what defines the test's scope: you do not need to ask for all six types, only the ones that answer the question of your next peak. If you are going to advertise on TV, you need the spike test; if your system operates all day, you need the soak test.
What the test delivers: capacity, response time and breaking point
The result that matters for decision makers fits into four answers:
- capacity: how many simultaneous accesses, or how many operations per second, the system handles within what was agreed;
- response time at that volume, measured as a percentile. "95% of responses under one second" means that, out of every 100 responses, 95 arrived in less than one second. Since each person receives several responses in a single visit, the share of people who got some slow response tends to be higher than 5%. The average hides those who waited a long time; the percentile shows them;
- error rate: how many requests failed or timed out;
- where it breaks and how: which resource ran out first (database, memory, connections, third-party service) and what to fix, in order of impact. The load tool measures what the user feels, such as time and errors; the resource that ran out shows up in server monitoring, turned on during the test.
This is not a yardstick invented for testing. The Banco Central uses the same capacity and percentile yardstick in Brazil's Open Finance: institutions' infrastructure must handle at least 300 simultaneous requests per second, and the daily 95th percentile of response time must stay at or below 1,500 milliseconds on the endpoints (the API access points) the manual classifies as high and medium-high frequency.
The breaking point often does not arrive gradually. Google's SRE book observes that many components do not degrade gracefully past a certain point: they fail all at once. In practice, the curve has a knee.
- Headroom More people come in and response time barely changes.
- Knee A resource gets close to its limit and the queue grows: each new request waits longer for the ones that arrived before it, and the time rises quickly.
- Saturation A resource runs out, such as database connections, memory or a partner's quota. Errors and timeouts appear.
- Outcome A well-designed system rejects some requests and stays up. A fragile one goes down entirely.
The fourth milestone is the one that matters most to decision makers, because the test does not only show when the system fails, it shows how. The same SRE book recommends taking each component to its limit in testing and observing: the vulnerable component starts to go down or return a very high error rate; the well-designed one rejects some requests and survives. It is the difference between a waiting queue with a clear message and a blank screen for everyone, and it is decided in the design, before the peak.
Response time matters even when nothing goes down. In a controlled experiment published in 2013, Microsoft made some Bing users 100 and 250 milliseconds slower for two weeks, and concluded that every 100 milliseconds of improvement was worth 0.6% of revenue. Slowness can cost money before it turns into an outage.
The cloud scales by itself? Up to the invoice
Autoscaling is a real and useful feature. It does not replace the test, for three reasons.
First, there are ceilings nobody configured. AWS, for example, sets a default limit of 1,000 concurrent executions on Lambda, its service that runs pieces of code on demand. The ceiling applies to each region and covers all the functions in the account combined. You can request an increase, but only those who know they will need it ask.
Second, not everything multiplies. Application servers get copies; the main database, a partner's quota and third-party services usually have a fixed limit, and that is where the bottleneck moves when everything else scales.
Third, the limit that remains is the bill. The k6 documentation advises against looking for the breaking point with elasticity (autoscaling) turned on, because the environment may grow along with the test and the only limit found ends up being the cloud invoice. During that test, the recommendation is to turn off elasticity on all components involved.
The same number works in the opposite direction, and there it can save money. Knowing how many users each server handles gives you a basis for paying only for the capacity you need. We have reviewed infrastructure with spare CPU and memory in both staging and production. An oversized machine is also a defect; it just shows up on the invoice, not on the screen.
Where to run the test without bringing down what already works
A load test generates real traffic, and poorly dosed it brings down what it was measuring. That is why choosing the environment is a trade-off:
- staging with minimal infrastructure does not measure performance, because it does not reproduce production. The k6 documentation recommends it for the smoke test, including running it on every delivery;
- an environment with the same configuration as production is the natural place for average load, stress and breakpoint tests;
- production gives the most faithful result and is the riskiest option. When it is the only viable one, the documentation recommends lower load during peak hours, tests outside peak hours and less aggressive test types.
One rule does not change with the environment: you do not test servers that are not yours. The k6 documentation says to turn off calls to third parties during the test, such as authentication, social sharing and analytics, unless you have permission. By the same logic, payment gateways and the partner's ERP come out of the test or go to a simulator that responds with the real partner's timing and limit, because a simulator that responds instantly makes the test optimistic. Firing thousands of calls at a partner's production ERP is, at the same time, a bad test and a relationship problem.
A load test plan answers this before the first run: which environment it runs in, at what time, with what maximum load, against which services and who monitors it.
Why we use k6
k6 started being developed in 2016 and is maintained by Grafana Labs, which announced the acquisition of the company behind it in June 2021. Version 1.0 came out in May 2025 with the promise of critical fixes for at least two years for each major version, and 2.0 came out in May 2026. For buyers, that counts: the tool has a responsible company and a public fix window for each major version. Four characteristics explain why it suits the kind of system we build.
The test is code. The script is written in JavaScript, lives in the repository alongside the system and is versioned like any other file. The engine that runs the test is written in Go. For buyers, this means the test can stay with the company when the project ends, as long as the script is part of the delivery: it runs again on the next version, before the next peak, with another team.
It runs in the delivery pipeline. The pipeline is the automatic sequence that checks and publishes each new version of the system. The pass criteria, which k6 calls thresholds, make the test fail when response time or error rate goes beyond what was agreed, and the tool returns an error to the pipeline. At first, the result works as an alert to investigate; the documentation itself recommends not relying only on pass or fail until the verification process is mature.
It lets you simulate customers arriving as in real life. In the model the documentation calls open, virtual users (robots that repeat the script as if they were customers) arrive at a defined rate, even if the system is responding slowly. That is what happens in real life: when the site gets slow, customers do not stop arriving, and the queue grows. In the closed model, each virtual user waits for the response before starting again, and the system's own slowness reduces the load it receives. That is why, when the question is the arrival rate, as on a site open to the public, the closed model may measure a better response time than the customer would see at peak and approve a system that cannot cope. Both models exist because they serve different goals, and choosing between them is part of the test plan.
One machine generates a lot of load. According to the documentation, a single k6 instance can simulate 30,000 to 40,000 virtual users, depending on the machine's resources. For buyers, that means little hardware to generate the test load. For larger scale, the same script runs distributed across several machines, in a Kubernetes cluster (a set of servers managed as if it were one), or on Grafana Cloud k6, the version where Grafana itself handles the infrastructure. Beyond websites and APIs, it tests real-time connections (WebSockets) and gRPC (another format for systems to talk to each other) without extensions, controls a real browser when the on-screen experience matters, and sends results to destinations such as Grafana Cloud k6, Prometheus and Datadog.
For implementers, a script in the open model, with the criteria in the file itself, looks like this (example values; the 1,500 ms limit copies the Open Finance yardstick):
import http from 'k6/http';
import { check } from 'k6';
export const options = {
scenarios: {
catalog_load: {
executor: 'ramping-arrival-rate', // open model
startRate: 10,
timeUnit: '1s',
preAllocatedVUs: 200,
stages: [
{ target: 50, duration: '5m' }, // ramp up to 50/s
{ target: 50, duration: '20m' }, // sustain
{ target: 0, duration: '2m' }, // ramp down
],
},
},
thresholds: {
http_req_failed: ['rate<0.01'], // error < 1%
http_req_duration: ['p(95)<1500'], // p95 < 1.5 s
},
};
export default function () {
const res = http.get('https://preprod.example.com/api/products');
check(res, { 'status 200': (r) => r.status === 200 });
}Generating the load is no longer the main cost. When Grafana announced the acquisition, CEO Raj Dutt recalled that load testing used to require expensive infrastructure investment, so only the best-funded initiatives reaped the benefit. Today the machine that generates the load can cost little: the distributed load testing solution AWS itself publishes estimates about US$ 30.90 per month in the default configuration, in an example with ten containers (small servers rented on demand) generating load for 30 hours a month, in the Virginia region in the United States, with prices subject to change. The cost of a load test is in the work: understanding the business's real peak, writing the script with the flows that matter, preparing data and environment, running, interpreting and fixing.
There is a Brazilian company that turned the result into a selling point. Cumbuca, a payment institution, publishes on its own website the summary of an April 2026 test done with k6: 52,000 requests per second, with 0.001% errors (the number highlighted on the page), and the ceiling found at the front door, not in the system itself: the load balancer, the component that distributes traffic among servers, could not keep up with opening more new encrypted connections. It is a good picture of what the test delivers: beyond the number, the place where it breaks, which may be outside the application. Grafana Labs, Cumbuca and the other companies cited are external to X-Apps and appear here for what they publish.
Doing the test with whoever develops the system has a practical advantage. A load test report ends in a list of bottlenecks, and someone needs to fix each one and run again. When the same team writes the code and the script, the fix does not depend on a second vendor. Load testing is part of our QA and test automation service when the system's risk is volume.
When another tool makes more sense
k6 is not the only good option, and switching tools may not be the priority. If your team already maintains test plans that work, what matters is that the test exists, runs before the peak and has criteria.
| Tool | Script written in | License | Makes more sense when |
|---|---|---|---|
| k6 | JavaScript or TypeScript (engine in Go) | AGPL-3.0 | the test will live in the repository and run in the pipeline |
| Apache JMeter | plan built in a graphical interface (Java application) | Apache 2.0 | the QA team prefers an interface and already has plans ready |
| Gatling | Java, JavaScript, TypeScript, Kotlin or Scala | Apache 2.0 in the core | the team lives in the Java or Kotlin ecosystem |
| Locust | Python | MIT | the team writes Python |
| Artillery | YAML (structured text file), JavaScript or TypeScript | MPL 2.0 for most of it | a simple scenario, described in a text file, does the job |
Source: official repositories and documentation of each project, read on October 2, 2026.
In JMeter, the documentation itself reserves the graphical interface for building the plan and says to run the load test from the command line, without the interface. In community interest, measured in GitHub stars in October 2026, k6 had more than 31,000, the highest among the five, followed closely by Locust. Stars measure interest in the project, not how many companies use it. All five have an open source core; the license column is the one your legal team checks before adopting.
When load testing is not the first thing to do
Not every outage is about volume. In a portal we operate, the system went down with few people using it. In the analysis, the CPU had headroom, memory was to spare, and the log did not say why the process had stopped. A load test on that system would measure the wrong thing. The first step there was different: logs that record the reason for the failure, resource metrics and alerts. The test shows the limit; monitoring shows what is happening now, and one does not replace the other.
For an internal system with few users and no predictable peak, it is also not worth starting with the full test. For it, a smoke test in the pipeline and good monitoring are the starting point.
The test also does not cover what nobody foresaw. Google's SRE book makes a similar caveat about capacity planning: it reduces the chance of a cascading failure, but it is not enough, because failures in distributing traffic between servers, communication cuts between parts of the network or unexpected traffic increases can concentrate load on one point beyond what was planned. Load testing reduces the part of the risk that can be known in advance. The other part is operations work.
What to put in the contract
If performance at real volume is not written down, it is not an acceptance criterion, and when the problem shows up the project may already be closed. The clause is short. With your business's numbers in place of the letters:
N comes from the real peak, not the average: access history, the campaign going on air, the date on your calendar. The script is delivered along with the code, so the test can run again without depending on whoever wrote it. And the smoke test goes into the pipeline, to check each new version with minimal load and flag a slowdown early, with the full test repeated before every known peak date.
Frequently asked questions
It is an open source tool for load and performance testing, maintained by Grafana Labs. The engine is written in Go and the test scripts in JavaScript, so the test lives in the repository alongside the system and can run in the delivery pipeline.
It can. The breakpoint test is designed to take the system to failure, and a poorly dosed test can prematurely bring down the environment it was measuring. That is why you start with few users, ramp up the load gradually and define the environment and time beforehand. In production, the k6 documentation recommends lower load during peak hours, tests outside peak hours and less aggressive test types.
No. The test shows the limit before the peak; monitoring shows what is happening now. A system that goes down with few users and no record of why first needs logs, metrics and alerts.
The short smoke test on every code change, in the delivery pipeline. The full test before every known peak date, after an infrastructure migration and when expected volume changes, such as when a large client comes on board.
Sources
- Grafana k6, official documentation (test types, thresholds, checks, open and closed models, protocols, results output, large tests, automated tests and website testing), grafana/k6 repository and release notes for versions 1.0.0, 2.0.0 and 2.3.0. Read on October 2, 2026.
- Grafana Labs, press release of June 17, 2021 on the acquisition of k6.
- Google, Site Reliability Engineering, chapters "Introduction", "Handling Overload", "Addressing Cascading Failures" and "Testing for Reliability", 2016.
- Kohavi et al., "Online Controlled Experiments at Large Scale", KDD 2013, Microsoft.
- Banco Central do Brasil, SPI Annual Report 2025; BCB Normative Instruction No. 615/2025 (Open Finance API Manual).
- Planalto (Brazil's presidential legal portal), CLT (Brazil's labor code), art. 459.
- Neotrust, Black Friday dashboard, read on October 2, 2026.
- Agência Brasil, articles from May 23, 2026 and June 1, 2026 on the 2026 income tax filing, and from January 27, 2022, February 7, 2022 and March 14, 2022 on the Sistema Valores a Receber.
- Bling, API limits page for developers; AWS, Lambda concurrency documentation and cost page for the Distributed Load Testing on AWS solution; Anthropic, API limits documentation. Read on October 2, 2026.
- Cumbuca, scale page with the summary of the April 2026 load test, read on October 2, 2026.
- Apache JMeter, Gatling, Locust and Artillery, official repositories and documentation, read on October 2, 2026.
- The experiences reported are from systems developed and operated by X-Apps, without identifying clients.





