When your API needs to handle 100K concurrent connections, you need a load testing tool that can keep up. Gatling is built on Akka and Netty — it generates massive load from a single machine while keeping resource usage minimal.
What Is Gatling?
Gatling is a high-performance load testing framework written in Scala. It uses an async, non-blocking architecture that can simulate thousands of concurrent users from a single machine. Tests are written as code in Scala, Java, or Kotlin — not XML, not YAML.
The Free API
Gatling OSS is completely free:
- Code-based tests: Write in Scala, Java, or Kotlin
- High performance: 10K+ virtual users per machine
- Rich DSL: Expressive scenario builder with checks and assertions
- HTML reports: Detailed performance reports with charts
- CI/CD plugins: Maven, Gradle, sbt integration
- Recorder: Generate tests by recording browser sessions
Quick Start
Create a Gatling project:
mvn archetype:generate \
-DarchetypeGroupId=io.gatling.highcharts \
-DarchetypeArtifactId=gatling-highcharts-maven-archetype
Write a load test in Java:
import io.gatling.javaapi.core.*;
import io.gatling.javaapi.http.*;
import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.*;
public class ApiSimulation extends Simulation {
HttpProtocolBuilder httpProtocol = http
.baseUrl("https://api.example.com")
.acceptHeader("application/json")
.contentTypeHeader("application/json");
ScenarioBuilder userFlow = scenario("User API Flow")
.exec(
http("Login")
.post("/auth/login")
.body(StringBody("{\"email\":\"test@test.com\",\"pass\":\"123\"}" ))
.check(jsonPath("$.token").saveAs("authToken"))
)
.pause(1)
.exec(
http("Get Profile")
.get("/api/profile")
.header("Authorization", "Bearer #{authToken}")
.check(status().is(200))
)
.pause(2)
.exec(
http("List Orders")
.get("/api/orders")
.header("Authorization", "Bearer #{authToken}")
.check(jsonPath("$.orders").exists())
);
{
setUp(
userFlow.injectOpen(
rampUsers(100).during(30), // Ramp to 100 users over 30s
constantUsersPerSec(50).during(120), // 50 users/sec for 2min
rampUsers(500).during(10) // Spike to 500
)
).protocols(httpProtocol)
.assertions(
global().responseTime().percentile3().lt(500),
global().successfulRequests().percent().gt(99.0)
);
}
}
Run:
mvn gatling:test
Why Teams Choose Gatling
A banking platform needed to prove their API could handle 50K concurrent users for regulatory compliance. JMeter crashed at 5K users on their test machine. Gatling ran 50K virtual users from a single 8-core server, producing detailed HTML reports that satisfied their auditors. The async architecture meant Gatling used 2GB RAM where JMeter needed 32GB.
Who Is This For?
- JVM developers wanting load tests in their native language
- Enterprise teams needing regulatory-grade performance reports
- Performance engineers requiring high-fidelity simulations at scale
- Teams migrating from JMeter to something modern
Start Testing at Scale
Gatling gives you enterprise-grade load testing without enterprise pricing. Code-based tests, massive scale from one machine, and reports that actually help you find bottlenecks.
Need help with performance testing or JVM optimization? I build custom testing solutions — reach out to discuss your project.
Found this useful? I publish daily deep-dives into developer tools and APIs. Follow for more.
Top comments (0)