Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use JMeter in Linux

2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of how to install and use JMeter in Linux, the content is detailed and easy to understand, easy to operate, and has a certain reference value, I believe you will have something to gain after reading this article on how to install and use JMeter in Linux. Let's take a look.

JMeter is a 100% pure JAVA desktop application designed to test client / server architecture (such as web applications). It can be used to test the performance of static and dynamic resources, such as static files, Java Servlet,CGI Scripts,Java Object, databases, FTP servers, and so on. JMeter can be used to simulate large loads to test the robustness of a server, network, or object or to analyze overall performance under different loads.

Preparatory work

1. A Linux machine

two。 Download jdk

3. Download jmeter

1. Configure Linux jdk environment

\ 1. Put the downloaded jdk into the Linux / root/java directory (note whether it is 32-bit or 64-bit when downloading). For example, my Linux system is 64-bit, download 64-bit jdk

\ 2. Decompress, extract command tar-zxvf jdk-8u191-linux-64.tar.gz

\ 3. Configure the jdk environment variable, edit / etc/profile, and add the following configuration at the end

Export JAVA_HOME=/root/java/jdk1.8.0_191export JRE_HOME=/root/java/jdk1.8.0_191/jreexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport PATH=$JAVA_HOME/bin:$PATH

\ 4. For the set configuration to take effect immediately, enter the command: source / etc/profile. Then type java-version to test

2. Configure jmeter

\ 1. You can copy the jmeter package on your windows to Linux directly.

\ 2. Extract to the same directory folder, extract command: unzip apache-jmeter-5.0.zip

\ 3. Configure the jmeter environment variable, edit / etc/profile, and add this configuration: export PATH=/root/jmeter/apache-jmeter-5.0/bin:$PATH

\ 4. Run the command source / etc/profile to make the configuration effective. If jmeter needs to add a plug-in, follow steps 1 and 2, and then overwrite it to the jmeter root directory.

3. Use the jmeter command

Jmeter-n-t test.jmx-l test.jtl

-h help-> print out useful information and exit

-n non-GUI mode-> running JMeter in non-GUI mode

-t test file-> JMeter test script file to run

-l log file-> the file that records the result

-r remote execution-> start remote service

-H proxy host-> set the proxy host used by JMeter

-P proxy port-> set the port number of the proxy host used by JMeter

4. Check the results of jmeter stress test

\ 1. After the test is complete, there will be an extra test.jtl file in the folder, copy it to the windows machine, and open jmeter on windows (Note: the versions of jdk and jmeter on Linux must be consistent with those on windows, including plug-ins)

\ 2. Create a new thread group and add the listeners you need to view

\ 3. Import test.jtl file and view the report.

Summary Report

Img

TPS

Response time

This is the end of the article on "how to install and use JMeter in Linux". Thank you for reading! I believe you all have a certain understanding of "how to install and use JMeter in Linux". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report