In brief
Choose Apache JMeter when the team tests many protocols (HTTP, JDBC, JMS, LDAP) and prefers building tests in a graphical editor. Gatling suits teams that write tests as code in Java, Kotlin or Scala and need an efficient generator with a readable report. Grafana k6 is written in JavaScript and plugs easily into CI/CD thanks to thresholds that fail the test with an error. All three have open cores; the choice depends on the system's protocols and the team's skills, not on a ranking.
Comparison in one table
Each of the three tools can handle a typical test of a web application and an HTTP API. The differences start with unusual protocols, how tests are written and how they work in a CI/CD pipeline.
| Aspect | Apache JMeter | Gatling | Grafana k6 |
|---|---|---|---|
| How a test is built | graphical editor, plan saved as XML (.jmx) | code in a DSL: Java, Kotlin, Scala | code in JavaScript |
| Engine | Java, a thread per virtual user | JVM, asynchronous | Go |
| Load model | classically a thread count; constant rate through timers | explicit: open and closed model | explicit: executors with a constant number of users or a constant request rate |
| Protocols out of the box | HTTP(S), JDBC, JMS, LDAP, FTP, SMTP, TCP and others | HTTP, WebSocket, SSE, JMS | HTTP/1.1, HTTP/2, WebSocket, gRPC |
| Extensions | plugins, Groovy scripts | JVM libraries | xk6 extensions |
| Report | HTML dashboard generated after the test | HTML report after the test | console summary, metrics export to external databases |
| Pass criteria | must be added (assertions, plugins, analysis in CI) | global assertions in the script | thresholds in the script |
| Core license | Apache 2.0 | Apache 2.0, commercial Enterprise edition | AGPL-3.0, commercial offering in Grafana Cloud |
Apache JMeter: protocol breadth and a graphical editor
JMeter is the oldest of the three tools and has the widest set of protocols out of the box. In one test plan you can call a REST API, send a message to a JMS queue and immediately check with a JDBC query whether the record reached the database. This is useful in the integration systems of banks and insurers, where a business path passes through several technologies.
The test plan is built in the graphical editor, but the test itself is run in headless mode, because the editor consumes generator resources and distorts results:
jmeter -n -t przelew.jmx -l wyniki.jtl -e -o raportWeaker points: a .jmx file is a verbose XML that is hard to review in a code review, and the one-thread-per-user model needs more memory with a large number of users. Large tests are therefore run in distributed mode, from several generators.
Gatling: tests as code and an efficient generator
Gatling describes a scenario in a readable DSL that compiles together with the rest of the code and goes through review like any other code. The engine is asynchronous, so one generator handles many virtual users at modest resource use. You choose the load model explicitly: open when the arrival rate of customers matters (a store, a campaign), or closed when the number of users is fixed (an internal system for a few hundred employees).
The HTML report after the test shows the distribution of response times, percentiles and the number of requests over time, which is usually enough for a first analysis. Gatling suits teams that write in Java or Kotlin and want to keep performance tests in the same repository as the application. It suits teams of testers without programming experience less.
Grafana k6: JavaScript and the CI/CD pipeline
k6 is written in JavaScript and runs in an engine written in Go. It is not Node.js: most npm packages cannot simply be imported, but the syntax is familiar to frontend and fullstack teams. The biggest advantage of k6 is thresholds: pass criteria are written in the script, and a test that does not meet them ends with an error code, so the CI/CD pipeline stops it by itself.
export const options = {
thresholds: {
http_req_failed: ['rate<0.01'],
http_req_duration: ['p(95)<800'],
},
};k6 does not generate an elaborate HTML report out of the box like JMeter does; metrics are usually sent to an external system (e.g. Prometheus or InfluxDB) and viewed in Grafana. How to set thresholds so they do not raise false alarms is described in the article Performance tests in CI/CD without false alarms.
When to use which tool, and when LoadRunner
A simple selection rule:
- JMeter, when the system uses many protocols besides HTTP, when the testers prefer a graphical editor or when the organization already has a library of .jmx plans.
- Gatling, when JVM developers write the tests, when a small number of generators for high traffic matters and when tests should live in the application repository.
- k6, when tests in the CI/CD pipeline are the priority, the team knows JavaScript, and metrics go to Grafana anyway.
The commercial LoadRunner is usually chosen by large organizations that test protocols that are hard for open tools (e.g. desktop applications and older client-server systems) or need extensive result analysis and vendor support. Regardless of the tool, the result depends on the load model, data and environment; we write about how to read results in the article Percentiles instead of averages.
The course of a full series of performance tests at a bank is shown by the case study Full performance testing of internet banking before a core system migration.
Questions and answers
Which tool is the fastest?
The question is better asked differently: how many generators do you need for a given traffic. Gatling and k6 usually use less memory per virtual user than JMeter, so at very high traffic they need fewer machines. A well-configured JMeter, in headless and distributed mode, also generates high traffic. The test result depends more on the script than on the tool.
Can tests be moved from JMeter to k6 or Gatling?
Only partially. Converters exist, but the JMeter plan logic, correlations and assertions usually have to be rewritten by hand. It is more sensible to start with new tests in the new tool and move old plans as the system changes, than to rewrite the whole library at once.
Is a free tool enough for testing at a bank?
Yes, if it supports the system's protocols and can reproduce the required traffic. Banks use both JMeter and LoadRunner; the choice depends on protocols, reporting requirements, team skills and license cost. The AGPL-3.0 license of k6 is worth reviewing with the legal department if the company modifies and redistributes the tool.
Does k6 test the application in a browser?
k6 has a browser module that drives a real browser and measures, among other things, page rendering times. Such a test uses far more resources than a protocol-level test, so a few browser users are usually combined with heavy traffic generated over HTTP.