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

Jmeter monitors server resources

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

one。 Scene

When doing performance testing, the resource indicators of the server are very concerned about the performance testing.

The indicators of performance test monitoring are mainly divided into two categories: resource indicators and system indicators.

1. Resource index is closely related to hardware resource consumption.

two。 System indicators are directly related to user scenarios and business requirements.

Resource index

CPU utilization: the percentage of CPU consumed by user processes and system processes. Generally speaking, the upper limit acceptable for a long time is no more than 85%.

Memory utilization: (1-Free memory / total memory) * 100%. Generally, at least 10% of available memory is left. The upper limit of long-term memory utilization is 85% acceptable.

Disks I write O is used to access data on disk: the percentage of time spent on read and write operations, and to measure disk read and write performance

Network I Pot O network bandwidth: indicates the rate of sending and receiving bytes to determine whether there is a bottleneck in the connection speed of the network. The value of this counter can be compared with the bandwidth of the current network.

SWAP: as the name implies, it is a temporary virtual memory area, but when there is insufficient physical memory, use part of the space to solve the problem of insufficient memory capacity.

How can I see swap? Here you can see the usage status of memory and swap (in MB)

System index

Number of concurrent users: the number of users who submit requests to the system at the same time

Number of online users: the number of users who access the system within a certain period of time. These users do not necessarily submit requests to the system at the same time.

Average response time: the average response time of the system processing transactions. The response time of a transaction is the time it takes from the client to submit the request to the server to respond.

Transaction success rate: in performance testing, define transactions to measure the performance indicators of one or more business processes, such as user login and order submission operations can be defined as transactions.

two。 How to monitor the key indicators of the server?

Mainly monitor Unix, Linux, Centos, etc.

Take unix as an example. Commands such as free, vmstat, sar, iostat monitor the usage of memory, CPU, disk IO, etc. Third-party tools include nmon, spotlight, etc.

Today we focus on the performance testing tool Jmeter monitoring server-side resources

three。 Jmeter monitors server resources

First add the listener jp@gc-PerfMon Metrics Collector

This is a plugin. It is recommended to download it on the official website.

Https://jmeter-plugins.org/(JMeterPlugins-Standard)

The old rule is to put the plug-in in% jmeterhome%/lib/ext and restart jmeter to take effect.

In order to avoid coding sensitive information during the demonstration, the local environment is used instead of the server (there is little difference between the two in nature)

As shown in the figure, after adding relevant information, and combining with the use cases in the actual thread group, it can be executed.

The log shows a mistake. what's going on? Don't worry, keep looking down.

Log shows Connection refused (Connection refused) because there is one more thing we haven't done. Lack of ServerAgent-2.x, send it to the server to decompress and use it. You may encounter permission problems, give him the appropriate permissions, and execute. / startAgent.sh. At this point, the preparation work is complete.

Okay, let's start startAgent.

After agent starts, we go back to jmeter to execute the script to verify that the monitoring we added is valid.

If you want to monitor the resource performance of the server, once or for a short time is not convincing and valuable, you can change the number of loops in the thread group, such as forever.

There are other methods, such as setting Ramp-Up, setting it to an appropriate value or using it in conjunction with the scheduler. You can try it yourself and observe the changes in resources. This is business scenario analysis, which is transformed into a use case.

Performance testing is a long-term investment process, not just a few runs of stress testing tools can detect problems. He needs engineers to use a lot of performance testing tools, basic knowledge of performance testing, server performance diagnosis, server performance monitoring, and a very clear understanding of the company's service architecture, middleware, operating system, database, network protocols, networks, gateways, routing, etc., as well as transforming the company's actual business into test scenarios and test cases.

Other additions:

Configure the server address and port number, start the thread group, view the listener performance rendering diagram, if the diagram proves to be successful, do not show the figure, check the log.

1. Confirm whether agent has started monitoring.

2. The default port number is 4444, and you can change the port by yourself.

3. Confirm with operation and maintenance whether the port number is open.

4. Confirm whether the pressure testing machine and the server are in the same network segment. If they are not in the same network segment, the pressure testing results will be inaccurate, and the operation and maintenance staff is required to re-open the pressure testing machine (the same network segment as the server).

It is also very convenient if you want to change the default port number.

Java-jar. / CMDRunner.jar-- tool PerfMonAgent-- udp-port 9999-- tcp-port 9999

You can use the 9999 port number.

Today's recommended reading articles are recommended

Why do interface testing?

JMeter database operation

Jmeter Interface Test-regular expression

JMeter returns garbled code in Chinese

Jmeter interface testing-parameterization

JMeter Interface testing-Basics

Test-impression

Add Wechat to the consulting work

scan a QR code

Welcome self-recommendation and recommendation, need Wechat to push resume!

Please poke the QR code below to learn more.

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

Internet Technology

Wechat

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

12
Report