Apache JMeter and Locust are two of the most well-known and popular load testing tools used by testers and developers in many IT (or maybe non-IT) companies. Since I got some years of experiences with JMeter as well as a couple of months with Locust I decided to compare them based on some particular criteria. However, I am not trying to announce a winner here but in the end, you may guess I love which one of these two!
What is load testing anyways?
The main goal of load testing is to determine a system’s performance under real-life load conditions. This testing helps determine how our application behaves when lots of users at the same time.
Load testings main goal:
• The maximum operating capacity of an application
• Determine whether the current infrastructure is sufficient to run the application
• Sustainability of application with respect to peak user load Number of concurrent users that an application can support
JMeter is one of the oldest
Locust, on the other hand, is a relatively young, written in Python. The main feature of this framework is that it allows you to write performance scripts in pure Python. Locust is highly scalable and flexible.
The licensing of a performance tool is essential to estimate the costs that are required for using the tool and other costs that would be associated with their use.
Both JMeter and Locust can be used freely without any restrictions on their usage. The licensing of JMeter is Apache License 2.0 and Locust has a MID license.
Pros of JMeter:
Ease of Use: Easy to install, just download, install and run. It comes preinstalled with default settings and does not require the user to have specific skills or knowledge to use
Compatibility: Having been developed in Java language it is compatible with all OS systems such as Windows, Mac, Linux
Vigorous Reporting: It generates comprehensive reports, making use of tools such as graphs, charts, tree view. In addition it supports different formats such as text, XML,HTML,and JSON
Definitive Testing: With JMeter, the user can do any kind of testing they want. Load Test, Stress Test, Practical Test, and dissemination Test, all in one tool.
Flexibility: The user can customize and modify JMeter to suit requirements and apply the automation to JMeter
Multi-practice Support: JMeter supports several protocols like HTTP, FTP, SOAP, JDBC, JMS, and LDAP. In addition, it can be used for verifying and testing the capabilities of the users’ database.
Cons of JMeter:
Memory consumption: JMeter can be used for heavy loads, this results in a very high consumption of memory and may lead to voluminous storage usage. Thus the users may be subjected to purchase further storage space
Pros of locust
Fast: Fast to develop and run
Hackable: Get and modify official and non-official code based on your need
Test Anything: even test functionality of the system in
Supports distributed: Define a master and as many as you want workers (slaves) for that.
Cons of Locust:
Not easy to use: well, for non-python users
Limited: can just test HTTP requests
Lack of rich documentation: as a young open-source project the community is on growing. The official documentation is not really useful sometimes.