When stress testing the services of the Linux server, the operation of the server can be observed by adding plug-ins instead of using the top command to view it in real time.
1. Resource preparation
2. Environmental preparation
3. Resource monitoring
1. Resource preparation
All jmeter plugins can be downloaded from this URL http://jmeter-plugins.org/downloads/all/
Universal network disk:
Plugins required this time:
JMeterPlugins-Extras.jar
JMeterPlugins-Standard.jar
ServerAgent-2.2.1
Put JMeterPlugins-Extras.jar and JMeterPlugins-Standard.jar in the apache-jmeter-3.0\lib\ext directory
Put ServerAgent-2.2.1 in the opt directory of the linux server
2. Environmental preparation
The ServerAgent service port number is 4444 by default, you need to set the firewall to not block this port:
vi /etc/sysconfig/iptables, add iptables under port 22 -I INPUT -p tcp --dport 4444 -j ACCEPT //Allow port 4444 access
Then start the monitoring service in the server:
Test for normal access locally:
Running telnet ip 4444 in cmd is equivalent to entering ip:4444 in the browser
Sometimes port 4444 is occupied, at this time you can switch to start port access
Use the following command to change the default port 4444
java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 7777 --tcp-port 7777
Similarly, port 7777 also needs to set firewall rules and use telnet to test whether it can be accessed locally
3. Monitor resources
After the jar package is placed under lib, there will be more monitoring plug-ins in the jmeter listener, and you can choose to add it.
Add detailed items in monitoring items, such as CPU, disk I/O and other information
For example: Now there is a demand, an average of 50 users log in every second, and it is necessary to observe the resource usage of the server within 2 hours
View Results
Note:
Encountered that the local computer telnet command cannot be recognized
In the control panel, find the telnet client and open it