28.6 C
Jaipur
Thursday, October 28, 2021

How to Download and Install Apache JMeter on Ubuntu 20.04

Must read

Apache JMeter is a desktop application to perform load testing and measuring the performance of a variety of services. It is completely free and open-source. JMeter is an Apache project and written in Java.

Apache JMeter may be used to test performance on static and dynamic resources. It started as a way to test web servers but developed to a lot more protocols like SOAP, FTP, Mail servers, or Database servers. JMeter can be used to simulate a heavy load on a server, group of servers, network, or object.

In this tutorial, we learn how to install Apache JMeter on Ubuntu 20.04. You can follow the same steps for other Linux distributions.

Prerequisites:

  • A Ubuntu Desktop 20.04 Desktop
  • A user with sudo access

Install Apache Jmeter on Ubuntu

Installing Apache JMeter is quite simple on Ubuntu and other Linux Distributions. JMeter requires java installed. You can either use JRE or JDK.

01. Install Java

First, make sure java is installed or not. Run the following command to check the java version.

$ java --version

To install the default java on Ubuntu, type:

$ sudo apt install default-jre

02. Download Apache JMeter

Visit Apache JMeter download to find the latest version of JMeter. Here I am downloading JMeter 5.4.1 zip file.

save the Jmeter zip file

Alternatively, you can download JMeter using terminal:

$ wget https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.4.1.zip

03. Extract Archive file

You can find a .zip file under the Downloads directory. To extract, right-click on the .zip file and from the menu choose ‘Extract Here’.

extract JMeter zip file

The same you can perform from terminal using:

$ unzip apache-jmeter-5.4.1.zip

04. Run the Jmeter

To run the JMeter you need to change the directory as following

$ cd apache-jmeter-5.4.1/bin

Now run the JMeter using the following command:

$ ./jmeter

This will open the JMeter interface and all good to set up your Test Plan.

add test plan

First, add a name to your Test Plan ( here I kept the default name) and then create a Thread Group by right-clicking on the Test Plan and selecting from the menu Add > Threads (Users) > Thread Group

add thread group

In the Thread Group settings, you will have 3 important fields you will have to setup:

add thread properties

Number of Threads (users): This is the number of connections the application will use.
Ramp-Up Period (in seconds): The ramp-up period tells JMeter how long to take to “ramp-up” to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Threads number can also be greater then ramp-up if you wish to load concurrent threads.
Loop count: How many times the process will repeat.

Next right click on the thread group and click Add > Config Element > HTTP Request Defaults.

add HTTP request defaults

And enter the IP or hostname of the webserver you wish to test in the Server Name or IP field.

add webserver name or IP

Now you can add HTTP requests to the Thread Group by right-clicking on it and selecting Add > Sampler > HTTP Request

add HTTP request

And just add the path of the page you want to load. You can add multiple HTTP requests for example “/” (the root of the website), “/about.html” (about page), “/download.html” (download page) and so on.

add HTTP request path

Finally, add a Listener to the Thread Group – Add > Listener > View Results in Table.

You can run the Test Plan using the green Start button in the toolbar and the results will be shown in the table.

view JMeter results

You can pick from various graphs and tables. You can also choose various Threads and ramp-up numbers to stress the web server as much as you wish.

Conclusion

In this tutorial, we learned how to install Apache JMeter on Ubuntu 20.04. Thanks for reading, please provide your feedback and suggestions in the comment section.

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -

Latest article