Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Locust
Cyber Security

Locust

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Cyber Security

Locust is an open source load testing tool used to simulate many concurrent users or client requests against a website, API, or other service. It runs test logic in Python and distributes virtual user traffic across one or more load generators, so teams can measure responsiveness, throughput, and failure under load.

What Locust Is Designed to Test

Locust is built for load and performance testing, so the core question is not whether an application works in isolation, but how it behaves when many clients hit it at once. That makes it useful for revealing latency spikes, throughput ceilings, queue buildup, and failure modes that only appear under realistic concurrency.

Because Locust models users as code, it is especially suited to scenarios where traffic patterns need to be repeatable, parameterised, or chained across multiple requests. That makes it a practical fit for API-heavy services, login flows, checkout paths, and other journeys where a single request is less informative than a sequence of interactions.

How Locust Simulates Load

Locust uses Python-based test logic to describe virtual user behaviour, then runs those users across one or more load generators. This architecture matters because the test script is not just a traffic generator, it is the definition of user behaviour, pacing, branching, and think time, which shapes the realism of the test.

In practice, this means teams can vary concurrency, request mix, and timing to see how the target service responds as pressure increases. The tool does not itself make the system faster or safer, but it does expose whether the service can sustain expected demand without degrading in ways that would affect customers or downstream integrations.

What Results From a Locust Test Usually Mean

Locust results are only useful if interpreted against the workload being modelled. A low average response time can hide p95 or p99 degradation, and a stable test can still miss a failure mode if the scenario does not exercise the right dependencies, data paths, or authentication steps.

For that reason, the most important output is not raw request volume alone, but the relationship between load, latency, error rate, saturation, and recovery behaviour. A good Locust run shows where performance bends, where it breaks, and whether the service fails gracefully or collapses under pressure.

When Locust is used against APIs or protected services, the test also has to reflect the access pattern realistically. If authentication, session handling, or rate limiting are part of the normal path, the test should account for them so the observed behaviour matches production conditions rather than an unrealistically open endpoint.

Where Locust Fits in Performance Engineering

Locust is most valuable when teams use it as part of a broader engineering loop, not as a one-off stress exercise. It helps validate capacity planning, regression detection, and release readiness by comparing system behaviour before and after a change, or under increasing load as infrastructure scales.

It is also a useful tool for finding bottlenecks in application code, database access, caches, and downstream services because the test can be shaped around a business workflow rather than a synthetic benchmark. NIST Cybersecurity Framework 2.0 is a useful reference point when load testing is part of resilience and recovery planning, while CIS Benchmarks help establish a hardened baseline for the systems that host the test environment.

Risk and Threat Considerations

Load testing tools can create operational risk if they are pointed at production systems without clear scope, timing, and safeguards. Poorly controlled tests can disrupt real users, distort monitoring signals, or trigger autoscaling, rate limiting, and incident workflows in ways that make it hard to distinguish testing from an actual outage.

Failure mechanism: A high-concurrency test can exhaust CPU, memory, connection pools, or downstream dependencies faster than the service can recover, especially when the scenario also exercises authentication, database writes, or third-party calls.

Impact: The result can be degraded availability, misleading telemetry, customer-facing errors, or a false sense of resilience if the test workload does not resemble real usage closely enough.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0RC.RP-01 — Recovery Plan ExecutionLoad testing validates how systems recover after stress and failure.
DE.CM-01 — Data Flow MonitoringLocust results depend on observing service behaviour during traffic spikes.
Recommendation — Use RC.RP-01 to confirm recovery procedures still work under peak load. Monitor service and dependency flows during tests to spot saturation early.
CIS Controls v8CIS-12 — Network Infrastructure ManagementLoad testing depends on controlled infrastructure paths and capacity boundaries.
Recommendation — Verify test routing, segmentation, and capacity limits before running high-volume tests.

Practitioner Guidance

What to watch for: Define the workload before you run the tool. The most useful Locust scenarios mirror real user journeys, realistic pacing, and realistic data dependencies, so the results speak to the service you actually operate rather than a synthetic benchmark.

Governance implication: Treat load tests as controlled change activity. Teams should agree when the test is allowed to run, which environment it may touch, what blast radius is acceptable, and who owns stop conditions if the system begins to fail unexpectedly.

Practitioner takeaway: Locust is most valuable when it measures user-shaped behaviour under pressure, not just raw request volume.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org