Yuri Bushnev is a Head of System Quality at AlphaSense, with more than 5 years of experience in Quality Assurance, DevOps and Development.

Become a JMeter and Continuous Testing Pro

Start Learning

Test Your Website Performance NOW! |

arrowPlease enter a URL with http(s)
Feb 04 2021

8 Reasons You Should Use Gatling for Your Load Testing

This post was updated in February 2021.

Gatling is an open-source performance testing framework, which uses Scala, Akka and Netty as a technology stack and as its backbone. The first Gatling release was in January 2012. Since then, Gatling has had a couple of major releases almost each year, as well as a pretty extensive popularity growth across the performance engineering community.


As Gatling was created in order to write tests in the Scala programming language (which is a very powerful language but has a relatively small audience), you might think that this performance framework was designed mainly for a specific group of engineers or for limited needs. However, if you check how many articles you can find about this framework in comparison to the other well-known open source load testing tools, you might be surprised, because its popularity stayed pretty strong over the past years.


For example, if you research Gatling in StackOverflow, you will find that Gatling has x5 more posts than another very popular performance framework called Locust, which is also commonly used by many developers all over the world. Moreover, if you check the TIOBE index, which shows the popularity of programming languages across the world, you will find this trend:


gatling load testing

(Original image from here)


As you can see, Scala has its audience, but its popularity across developers is much lower than other languages like Java, C or JavaScript. So why is the Gatling framework still popular and commonly used in many companies? We will answer these questions and more below.


#1 Gatling Works Everywhere


Gatling is written in Scala, which allows you to run it on any system. That’s why you will never hit any trouble by using different local machines and cloud servers to run and create your tests.


#2 Create Gatling Tests as Code


For many developers, it is a huge benefit if they can write performance tests as source code, as Gatling does. This enables you to store tests under version control systems that enhance developers’ collaboration, keep historical changes clear and prevent us from losing the work we have done. In addition to that, code helps bootstrap the tests by refactoring, which is a powerful process in any popular code IDE application where you can write the Gatling tests.


#3 Gatling has Detailed Metrics Dashboards Out-of-the-Box


Gatling offers detailed metrics dashboard that you can see after tests execution without having to add any additional plugins. The report is stored as an HTML file, which can be easily saved for some future analyses and metrics comparison. In addition to that, the report is interactive. which allows you to perform more detailed analyses and concentrate specific requests in addition to the overall picture.


load testing with gatling


#4 Gatling is Powerful!


First, it’s worth saying that all performance tools should be powerful by the nature of their purpose. But Gatling definitely has an advantage over many other frameworks (like JMeter), because it uses advanced architecture and the Akka toolkit, which is based on the actor model that is distributed and fully asynchronous by design. Thanks to the Akka toolkit, Gatling doesn’t allocate a separate thread for each user. Instead, all multi-threading is done via messages between  actors (universal primitives of concurrent computation), which allow to simulate a list of users by using just one thread. You can check out this short article to get a better understanding of the actor model.


In performance testing, there are many important factors that impact results and the capabilities of performance tools. That’s why a performance tool with a better architecture will not necessarily provide you with better performance. But in this case, based on my own observations, Gatling handles the load better than JMeter and can help you save CPU and RAM, which will help you simulate a bit more users. We will definitely cover this topic more thoroughly in some of our next articles!


#5 Gatling has Capable Assertions


Gatling has an integrated assertions API, which gives you a full arsenal to perform functional assertions. This API allows you to run different types of functional checks along with your performance testing. The Gatling assertions API is flexible and allows you to run all checks either for specific requests or for all requests at once:


//verifies that each request has no more than 2 percents of failed requests

//verifies that ‘Login’ request takes between 1 second and 5 seconds
setUp(scn).assertions(details("Login").requestsPerSec.between(1000, 5000))


#6 Gatling Uses Human Readable Tests


Gatling tests are very elegant, because Gatling defines a domain-specific language that allows writing very clear and human readable tests. This is important because it helps teammates work together on the same scenarios without spending time on additional knowledge transfer. Even a not very technical manager can more or less understand the mentioned scenario:


import io.gatling.core.Predef._ 
import io.gatling.http.Predef._
import scala.concurrent.duration._

class HomePageSimulation extends Simulation { 

  val httpConf = http 
    .acceptEncodingHeader("gzip, deflate")
    .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0")

  val test = scenario("HomePageSimulation") 
    .exec(http("Blazdemo Home page")  



Moreover, Gatling makes tests implementation fun. It is very important to enjoy tests creation and human readable tests can definitely help you with that!


#7 Gatling has Built-in Integration with Continuous Integration Pipelines


Gatling performance tool can be fully executed by using the command line, making it compatible with any Continuous Integration platform. You will be doubly happy if you use Jenkins continuous integration service, because you can use the pretty useful Jenkins Gatling plugin, which lets you keep track of performance metrics trends in the main screen of the test build plan.


run your performance tests with open source gatling


#8 Gatling Provides Smooth Integration with Real Time Monitoring Tools


One of the most important aspects of performance testing is execution monitoring. Real-time monitoring allows you to keep execution under control. Also, sometimes it doesn’t make sense to wait until the test is finished as even initial results sometimes can give you all the answers.


That’s why Gatling provides very straightforward integration with real-time monitoring tools. As a first option, you can use the Gatling Frontline, which is the commercial version of the Gatling open source framework. As a second option, you can easily integrate Gatling with Taurus, which can give you very configurable tests execution and detailed real-time online reporting. Finally, you can just integrate the Gatling framework with Open Source monitoring tools like Grafana. With the help of in-built Graphite/InfluxDB integration (a well-known time-series databases) Grafana monitoring can be achieved by just changing some Gatling configuration files. We will show how to do this in our future blog posts.


Run your Gatling tests with BlazeMeter! Get scalability, multiple geo-locations and advanced reporting. To learn more, request a demo. Or, put your URL in the box below and your test will start in minutes.

arrowPlease enter a URL with http(s)

Interested in writing for our Blog?Send us a pitch!