Skip to main content

JMeter vs Gatling: The Same Test Run in Both Tools

JMeter vs Gatling, tested: the same 2,000-user run took 2,037 threads in JMeter and 65 in Gatling. Scripting, protocols, reports, CI exit codes and scaling.

JMeter vs Gatling: The Same Test Run in Both Tools

JMeter vs Gatling comes down to how tests are written and who writes them. Apache JMeter builds tests in a GUI and saves them as XML (.jmx) files, runs each virtual user on its own thread and supports the widest range of protocols. Gatling writes tests as code in Java, Kotlin, Scala, JavaScript or TypeScript, runs virtual users on a small number of threads, and fails a build on its own assertions.

Both are free and open source under the Apache 2.0 licence, apart from Gatling’s gRPC and MQTT modules, which ship under Gatling’s own Enterprise Component License. To compare them on more than feature lists, we ran the same tests in JMeter 5.6.2 and Gatling 3.16.0 against one local API. On an everyday test they reported nearly identical numbers. With 2,000 concurrent users, JMeter ran 2,037 threads and Gatling 65. And with one request in ten failing, JMeter exited with code 0 while Gatling’s assertion failed the build.

Key Takeaways

  • Pick by who writes the tests. Testers who prefer a GUI and no code are better served by JMeter; developers who want tests reviewed and versioned like code are better served by Gatling.
  • For an ordinary HTTP test, results agree: 94.8 vs 95.7 requests a second, median 202 ms vs 191 ms, on the same 20-user test.
  • Gatling uses far fewer threads per virtual user. At 2,000 users it ran 65 threads and used about 30% less CPU per request than JMeter’s 2,037 threads.
  • JMeter covers more protocols out of the box (JDBC, FTP, LDAP, mail, TCP). Gatling’s gRPC and MQTT support is limited to 5 users and 5 minutes in the free edition.
  • Distributed load is free in JMeter (client-server mode) and part of Gatling’s paid plans. LoadFocus runs JMeter scripts in the cloud, not Gatling simulations.

JMeter vs Gatling at a glance

Apache JMeter 5.6.3Gatling 3.16.0
LicenceApache 2.0, freeApache 2.0 Community Edition (gRPC and MQTT modules under an Enterprise Component License); paid Enterprise plans
How tests are builtGUI, saved as .jmx XMLCode: Java, Kotlin, Scala, JavaScript, TypeScript
RuntimeOne thread per virtual userAsynchronous, a few threads for many users
Java neededJava 8 or later64-bit OpenJDK LTS 11 to 25
Built-in protocolsHTTP, JDBC, FTP, LDAP, JMS, SMTP, POP3/IMAP, TCP, Java, OS processHTTP, WebSocket, SSE, GraphQL, JMS; gRPC and MQTT with free-edition limits
Load modelsThread Group (closed), Open Model Thread Group (experimental)Open and closed injection profiles
Pass or fail in CINot built in: exit code 0 with errorsAssertions fail the run with exit code 1
ReportHTML dashboard on request (-e -o or -g)HTML report after every run
Distributed loadFree client-server modeGatling Enterprise (paid)
RecorderHTTP(S) Test Script RecorderGatling Recorder

Versions and limits are from each project’s documentation as of November 2026. Our runs used JMeter 5.6.2; nothing in the 5.6.3 release notes changes what we measured.

What is the main difference between JMeter and Gatling?

JMeter is a GUI application: you build a test plan by adding thread groups, samplers, extractors and assertions in a tree, and JMeter saves it as XML. Gatling is a library: you write a simulation as code, compile it with Maven, Gradle or sbt (or the JavaScript CLI) and run it from the command line. Everything else follows from that choice.

A JMeter test plan is readable in the GUI and hard to read in a code review, because the .jmx file is long XML. A Gatling simulation is short and reviewable, and it needs someone who can write and debug code. JMeter does allow code where you need it, through JSR223 elements in Groovy, and Gatling has a recorder that turns a browser session or a HAR file into a starting simulation. But the default way of working is different, and so is the team each tool suits.

How do the scripts compare?

Our test logs in once per virtual user, saves the token, then loops a product-list request and an order request that sends the token. In Gatling’s Java DSL that is one class:

ScenarioBuilder shop = scenario("Shop")
    .exec(http("POST login").post("/api/login").body(StringBody("{}"))
        .check(jsonPath("$.token").saveAs("token")))
    .during(Duration.ofSeconds(60)).on(
        exec(http("GET items").get("/api/items"))
        .exec(http("POST order").post("/api/orders")
            .header("Authorization", "Bearer #{token}")
            .body(StringBody("{\"sku\":\"A1\"}"))
            .check(status().is(201))));

{
  setUp(shop.injectClosed(rampConcurrentUsers(0).to(20).during(10),
                          constantConcurrentUsers(20).during(50)))
      .protocols(http.baseUrl("http://127.0.0.1:8099"));
}

In JMeter the same test is a Thread Group (20 threads, 10-second ramp-up, 60-second duration) holding a Once Only Controller with the login request and a JSON Extractor, an HTTP Header Manager that sends Bearer ${token}, and the two requests. Built in the GUI it takes a couple of minutes; saved, it is more than a hundred lines of XML. Our JMeter correlation guide shows the extractor side step by step, and our Gatling tutorial walks through a full simulation.

Do JMeter and Gatling report the same results?

Yes, for an ordinary test. Both tools measured the same server the same way: response time from sending the request to receiving the response. On our test API, 20 virtual users running the test above kept the server’s workers busy and gave:

JMeter 5.6.2Gatling 3.16.0
Requests5,729 in about 60 s6,700 in about 70 s
Requests per second94.895.7
Median202 ms191 ms
95th percentile250 ms237 ms
99th percentile272 ms251 ms
Errors00

The server was the limit in both runs, so throughput matched. Gatling’s run was 10 seconds longer because each Gatling user loops for 60 seconds from the moment it starts, and the last users started 10 seconds in; JMeter’s 60-second thread lifetime counts from the start of the test. With the server as the bottleneck, a 10 to 20 ms gap in latency says more about run length and timing than about the tools. If two tools disagree a lot on the same test, the test setup differs, not the stopwatch.

Which uses fewer resources, JMeter or Gatling?

Gatling, by a wide margin in threads and a smaller one in CPU. JMeter runs every virtual user on its own operating system thread. Gatling is built on asynchronous, non-blocking networking, so a few threads serve thousands of users. The difference grows with the number of users, especially when responses are slow and users spend most of their time waiting.

We ran 2,000 concurrent users in each tool against an endpoint that waits 1 second before answering, sampling the load generator process with ps from start to finish. The laptop was also running other heavy work, so we ran the pair twice; the table shows the second pair, the only one sampled from start to finish in both tools:

2,000 users, 1-second responsesJMeter 5.6.2Gatling 3.16.0
Requests completed92,238 in 60 s104,436 in 80 s
Errors00
Median, 99th percentile1,118 ms, 1,515 ms1,112 ms, 1,778 ms
Peak threads in the process2,03765
Peak memory (RSS)811 MB203 MB
CPU time per 1,000 requests0.26 s0.18 s

The first pair, run while the laptop was less busy, gave the same picture: 2,038 threads against 65, and 0.19 s against 0.13 s of CPU per 1,000 requests, so Gatling used about 30% less CPU per request both times. Gatling completed more requests because each of its users loops for 60 seconds from its own start, after a 20-second ramp. Both handled 2,000 users on a laptop without errors, so JMeter’s thread-per-user design was not a problem at this size. The memory row needs a caveat: JMeter’s launcher starts its heap at a fixed 1 GB (-Xms1g -Xmx1g), while Gatling’s forked JVM had a 1 GB maximum and grew only as needed, so part of that gap is configuration. The thread count is the structural difference, and it is what limits how many users one JMeter machine can run before its own scheduling adds delay to the numbers.

Which supports more protocols?

JMeter, for anything beyond web traffic. Its built-in samplers cover HTTP, JDBC databases, FTP, LDAP, JMS, SMTP, POP3 and IMAP mail, raw TCP, Java classes, JUnit tests and operating system commands, with more through plugins. Gatling covers HTTP, WebSocket, server-sent events, GraphQL and JMS, plus gRPC and MQTT.

The gRPC and MQTT protocols come with a catch that feature tables often miss. Gatling’s documentation says both can be used with the free Community Edition, but usage there is limited to 5 users maximum and 5-minute tests; the limits are lifted on Gatling Enterprise. For a gRPC or MQTT load test beyond a smoke test, the free option is JMeter with a plugin, or another tool. Our gRPC load testing tools roundup lists the options.

How do JMeter and Gatling fit in a CI/CD pipeline?

Gatling fits with less work. Its assertions, such as “fewer than 1% failed requests” or “95th percentile under 500 ms”, are checked at the end of the run and turn a breach into a failed build. JMeter in non-GUI mode exits with code 0 when the test completes, however many requests failed, so a pipeline needs its own check of the results file.

We ran the same endpoint, failing one request in ten, through both:

Global: percentage of failed events is less than 1.0 : false (actual : 10.0)
Global: 95th percentile of response time is less than 500.0 : true (actual : 100.0)
[ERROR] BUILD FAILURE

Gatling’s Maven run, 10 users sending 20 requests each, exited with code 1. JMeter sent 200 requests from 10 threads to the same endpoint, recorded 20 errors (10.00%) and exited with code 0. To gate a JMeter run, parse the results file in a script, use a plugin such as a CI server’s performance plugin, or run it on a platform that applies thresholds. Gatling also writes its HTML report after every run, while JMeter builds its HTML dashboard report only when asked with -e -o or -g.

How do JMeter and Gatling model load?

Gatling makes you choose: injectOpen schedules new users arriving at a rate, and injectClosed keeps a set number of users active. JMeter’s standard Thread Group is a closed model, a fixed number of threads looping. Since 5.5, JMeter also has the Open Model Thread Group for arrival rates, still labelled experimental.

The choice matters more than the tool. A closed model sends less load when the server slows down, which hides overload; an open model keeps arriving and shows it. Our guide to JMeter thread groups runs both models past a server’s capacity and shows how different the results look.

How do you scale JMeter and Gatling beyond one machine?

JMeter has a free client-server mode: one controller sends the test plan to several JMeter servers, which generate the load and stream results back., and you set up and look after those machines yourself. Gatling’s Community Edition runs a simulation on the machine you start it on, and Gatling’s pricing page lists distributed testing as a feature of its paid Enterprise plans.

Our JMeter distributed testing guide covers the JMeter setup. You can run Gatling by hand on several machines and merge the results yourself, but there is no built-in coordinator in the free edition. If your team needs load from many machines or regions without paying for a Gatling plan, JMeter’s client-server mode or a cloud service that runs .jmx files covers it.

When to choose JMeter and when to choose Gatling

Choose by your team and your protocols first, and by performance only at large scale. Both tools produce trustworthy numbers when the test is set up well.

Choose JMeter when:

  • testers who do not write code own performance testing;
  • you test databases, mail, FTP, LDAP or raw TCP alongside HTTP;
  • you need gRPC or MQTT at more than 5 users without a paid plan;
  • you want free distributed load from your own machines, or a cloud service that runs .jmx files.

Choose Gatling when:

  • developers own the tests and want them reviewed and versioned like application code;
  • the team already works in Java, Kotlin, Scala or TypeScript;
  • you want a pass or fail in CI without writing your own results check;
  • one load generator must hold many thousands of mostly idle users.

If neither fits, k6 is the usual third option for JavaScript teams. Our k6 vs JMeter vs Gatling vs Locust comparison puts all four side by side.

Running JMeter tests at scale without managing load generators

The scaling gap is where many teams look for a managed service. LoadFocus runs uploaded JMeter test plans from 25+ cloud regions: you set virtual users, duration and ramp-up per run, and LoadFocus starts the machines, spreads the threads across them and shuts them down after the test. It runs JMeter and k6 scripts but not Gatling simulations.

The Gatling alternative page sets out when that matters and when staying on Gatling is the better choice. For JMeter, see JMeter load testing in the cloud.

Frequently Asked Questions

Is Gatling better than JMeter?

Neither is better overall. Gatling is better for developers who want load tests as code in version control, pass or fail results in CI, and many users per machine. JMeter is better for testers who prefer a GUI, for protocols beyond HTTP, and for free distributed load. On the same HTTP test, both reported nearly the same throughput and latency.

Is Gatling faster than JMeter?

Not in the response times it measures, but Gatling needs fewer resources per virtual user. In our tests with 2,000 concurrent users it ran 65 threads against JMeter’s 2,037 and used about 30% less CPU per request. Both completed the test without errors, and the response times they measured were close, so the difference matters at large user counts on one machine.

Does Gatling require coding?

Yes. A Gatling test is a simulation written in Java, Kotlin, Scala, JavaScript or TypeScript. The Gatling Recorder can generate a first version from browser traffic or a HAR file, but changing and maintaining it means editing code. JMeter tests are built in a GUI and need code only for custom logic.

Can Gatling run JMeter scripts?

No. Gatling cannot run JMeter’s .jmx test plans directly. Gatling offers a JMeter to Gatling Converter, an AI coding-assistant skill that reads a .jmx file and writes an equivalent simulation, and it works with the free edition. Gatling’s own page says complex Groovy scripts and custom injection profiles may need manual review.

Is Gatling free?

The Gatling Community Edition is open source under the Apache 2.0 licence and free to use. Distributed testing, hosted load generators and unlimited gRPC and MQTT use are part of the paid Gatling Enterprise plans. JMeter is free in full, including its distributed mode.

Sources

  • JMeter samplers and Thread Group options: Apache JMeter User’s Manual, Component Reference, jmeter.apache.org/usermanual/component_reference.html, November 2026.
  • JMeter 5.6.3 as the current release and its changes: jmeter.apache.org/download_jmeter.cgi and jmeter.apache.org/changes.html; Open Model Thread Group added in 5.5: jmeter.apache.org/changes_history.html, November 2026.
  • Gatling SDK languages and Java requirements: docs.gatling.io, Java SDK installation guide, November 2026.
  • Gatling protocols, and the Community Edition limits for gRPC and MQTT (5 users, 5-minute tests): docs.gatling.io, gRPC setup and MQTT setup pages and the protocol reference, November 2026.
  • Gatling injection profiles: docs.gatling.io/concepts/injection, November 2026. Gatling assertions: docs.gatling.io/concepts/assertions, November 2026.
  • Gatling editions and distributed testing: gatling.io/pricing, November 2026. Community Edition “for local use only” and the JMeter to Gatling Converter: gatling.io/product/jmeter-converter, November 2026. Recorder and HAR import: docs.gatling.io/reference/script/http/recorder, November 2026.
  • Gatling 3.16.0 and gatling-maven-plugin 4.21.12 release dates: repo1.maven.org, maven-metadata.xml, November 2026.
  • LoadFocus JMeter runs and its Gatling comparison: loadfocus.com/jmeter-load-testing and loadfocus.com/alternatives/gatling-alternative, read 1 November 2026.
  • Test runs: Apache JMeter 5.6.2 (non-GUI) and Gatling 3.16.0 (Maven, Java DSL), both on Java 17.0.20, against a local Node.js 23.11.1 test API on an Apple M1 Max, 1 November 2026. Process threads, memory and CPU were sampled with ps for the whole of each run in the second pair (the first pair sampled Gatling’s forked JVM from 25 seconds in). The laptop carried other heavy work during the runs (load average above 100), so compare the tools within a pair, not between pairs. Timings show patterns, not benchmarks.

Bogdan

Founder at LoadFocus

Bogdan builds and runs the tools this blog is about. He writes from what the products actually do in production, including the parts that break.

Weekly tips right in your inbox.

Don’t miss out on the latest testing tips and tricks, tools and news related to software testing.

Already +20,000 members in the list.

The Load Testing Platform with AI That Explains Your Results

Load test websites and APIs from 25 cloud regions, monitor page speed and uptime, and get AI analysis that explains your results in plain English.

Cloud load testing, website speed and API monitoring in one place.

Hi there! Can I share a cool thing I'm working on with you?

A software testing newsletter that sparks joy.

Our goal is to create helpful content for software developers and testers.

If you're not into it, you can unsubscribe instantly.