# Load testing

> Simulating lots of users at once to see how a system holds up before real ones arrive.

- Level: Intermediate
- Topics: Cloud, Software
- URL: https://tidbit.legios.com.ar/load-testing/
- In Spanish: [Pruebas de carga](https://tidbit.legios.com.ar/es/load-testing/)

**Load testing** means sending a large, controlled amount of fake traffic to an app or API to measure how it behaves under pressure. A tool plays the part of thousands of users, logging in, searching, paying, and records response times, error rates and how much CPU, memory and database capacity the system uses as the numbers climb.

There are a few flavors. A plain **load test** checks the traffic you expect, like a normal Monday peak. A **stress test** keeps pushing until something breaks, to find the limit and see how it fails. A **spike test** jumps from quiet to huge in seconds, like a ticket sale opening, and a **soak test** runs a steady load for hours to catch slow leaks. Popular tools include k6, JMeter, Gatling and Locust.

It matters because performance problems rarely show up with one tester clicking around. A query that takes 20 ms alone can take seconds when a thousand people run it at once. Running load tests before a launch or a big sales day tells you whether autoscaling kicks in fast enough, where the bottleneck is, and how many servers you really need. Run them against a test environment, or tell your cloud provider and your team first: to a server, a load test looks a lot like an attack.

## An analogy

Before opening a new bridge, engineers drive heavy trucks over it and watch how much it bends. Load testing is the same, with fake users instead of trucks.

## Keep in mind

- Simulated traffic to measure speed, errors and resource use under load.
- Variants: load, stress (find the limit), spike, soak (long duration).
- Common tools: k6, JMeter, Gatling, Locust.
- Do it before launches or peak days, and warn people first.

## Go deeper

- [Load testing on Wikipedia](https://en.wikipedia.org/wiki/Load_testing)
- [Load testing guide (Grafana k6 docs)](https://grafana.com/docs/k6/latest/testing-guides/test-types/load-testing/)
- [Software performance testing on Wikipedia](https://en.wikipedia.org/wiki/Software_performance_testing)

## Related terms

- [API](https://tidbit.legios.com.ar/api/): The menu of things one program lets another program ask for.
- [CPU](https://tidbit.legios.com.ar/cpu/): The chip that runs your programs, one instruction after another, very fast.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
- [Autoscaling](https://tidbit.legios.com.ar/autoscaling/): Adding and removing servers automatically as demand goes up and down.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [Cloud computing](https://tidbit.legios.com.ar/cloud-computing/): Renting computers over the internet instead of buying your own.
