2020 / 1 / 27
Apache JMeter vs Gatling Tool- Load Testing Part 2
In the last blog post, we have seen that there are 10 categories on the basis of which we have attempted to drive a comparison between Apache JMeter and the Gatling tool.
We have already covered the first 5 categories in the previous blog post. We will discuss the rest 5 categories and will attempt to arrive at a conclusion.
1. Flexibility: We will see the list of features of the 2 tools. Which protocols they support.
JMeter supports a variety of protocols:
Now we will see the list of protocols that Gatling support:
There is also a small list of protocols that Gatling do not support, but that are supported
So, you can clearly see JMeter has more set of features, thus more flexibility in load
testing than Gatling. JMeter is a winner in this comparison.
2. Scripting: One of the biggest differences among both the tools is the way they save the file.
Jmeter saves the project as an XML file with jmx extension. JMX is more verbose than
the Gatling Scala Simulation. JMeter has GUI to open and display the jmx file. Do not attempt to modify the JMX file yourself, as these files are not sustainable.
In Gatling, projects are saved as simulations. Gatling simulations can be edited and modified directly. Gatling has no GUI, this means you have to write the code to modify the simulations. Scala IDE can be used to modify Gatling Simulations.
JMeter is user-friendly due to the GUI part but you can not edit the JMX file. On the other hand, Gatling has no GUI, thus you have to write code to do the modification, but it is still possible to modify simulations. It is entirely your choice to decide which tool to use if we decide on the basis of Scripting.
3. Performances: We will discuss the paradigms used by 2 tools that affect the performance of the tools.
JMeter uses One Thread= One User Paradigm. It means the simulated user is equal to one thread where Thread.sleep() is used to simulate Wait time.
Gatling, on the other hand, uses much more advanced technology, Akka. Akka allows for full asynchronous computing. It is a distributed framework based on the Actor Model which can simulate multiple virtual users with a Single Thread.
Here, Gatling is surely ahead of JMeter, but one of the major limitations is Network Bandwidth bottleneck, where simulating multiple virtual users on a single machine reduces the network bandwidth.
Choosing among JMeter or Gatling is completely your choice. You simply need to list your project requirements, which will help you to make a more wise decision.
We have tried to help you to get an insight into each tool feature that will help you to at least decide which tool is more appropriate as per your requirements.
4. Test Execution:
JMeter Test Execution:
JMeter can be executed in 3 different modes:
a. GUI Mode
b. Server Mode
c. Command-line Mode
a. GUI Mode: **If you are using Windows, navigate to the bin folder in the installed directory. You will find a Windows Batch File under the name jmeter.bat**
Just execute this Batch File and You will see the Apache JMeter Windows.
b. Server Mode: **Server Mode is designed for Distributed Testing Environment** like a Client-Server Model, where Apache JMeter will run in Server Mode on Server Computer and in GUI Mode on Client Computer.
To start JMeter in Server Mode, just execute the Windows Batch File jmeter-server.bat in the bin directory.
c. Command Line Mode: Running JMeter in GUI Mode consumes a lot of computer memory. This is why it is not advisable to run JMeter in GUI Mode for Load Testing. For saving resources, you may choose to execute JMeter in Command Line Mode.
jmeter -n -t SampleTest.jmx -l testlog.jtl
-n: Specifies JMeter to run in Non-GUI Mode.
-t: Specifies the name of JMX File containing the test plan.
-l: Specifies the name of the JTL file to log test results.
Other than these options, there are so many parameters available. You can find
JMeter offers the user an option to save the JTL file while executing the test in Command-line mode and view the graphical view of results using the saved JTL file.
There are a variety of listener interfaces available in GUI Mode.
Gatling Tool Test Execution:
Gatling can be executed in 1 mode:
So, it does not support the Graphical view of the results. There is a lack of UI Result Listeners.
We can say, that in a way JMeter is a clear winner here, as it supports a variety of
modes. User can decide as per the requirements and availability of resources.
5. Cloud Load Testing:
JMeter Cloud: There are many companies like FloodIO, RedLine 13, HP Storm Runner, etc that support cloud load testing for JMeter.All of them provide a facility to scale load tests in the Cloud and provides basic reporting.
Gatling Cloud: Companies mentioned above also support the Gatling Tool. The Exception to this is HP Storm Runner. Gatling Frontline is a defacto standard for running Gatling tests in the cloud.
We can say, JMeter is a winner here as Apache JMeter is supported by majority of companies in the market for load testing in the cloud.
After such a thorough and detailed comparison, I think it is pretty clear that each tool has its own pros and cons. It simply depends upon your project resources and requirements, which tool to use.