jmeter (fifty-one) _ server resource monitoring and analysis of the performance test

Outline

Performance testing, monitoring of server resources is essential. Resources here was divided into two pieces, windows and linux

 

linux under the supervision of resources

Visit our Web site http://jmeter-plugins.org/downloads/all/ , download three files. Which JMeterPlugins-Standard and JMeterPlugins-Extras is a client, ServerAgent is server-side.

The first two are jmeter extension, after decompression copy jar package to the next lib / ext directory jmeter, and the last one is server monitoring plugin, extract it to the server

The rear ServerAgent-2.2.1.zip decompression on the need to monitor the server and perform

chmod 777 startAgent.sh empowerment

./startAgent.sh start monitoring

Configure the ports and ip, the default port 4444

You can modify the default port --./startAgent.sh -udp-port 0 -tcp-port XXXX on the server

When properly configured, but has never been able to monitor the server, you need to consider whether the 4444 port is disabled in the server firewall!

Run View Results

jmeter hidden features: specify a process ID to monitor. Double-click an empty place, three points will appear on the right. Here you can monitor server resources according to the process number pid

 

Monitoring CPU

Representative values ​​are percentages, such as the default values ​​to see a certain time in the graph 30 is arranged, which represents the total cpu time at this time accounted for 30%.

Two of the more useful place worthy of note:

1: In the Scope area, you can get CPU usage of a specified process by Per Process Options

2: CPU Cores area, we can select individual Core surveillance specified.

Monitoring Memory

usedperc(默认)和freeperc两项的数值代表与总内存的百分比,其余指标项的数值都是指内存大小,选中对应项,可以看到Metric Unit区域单位配置将变为可用,通常Mb会比较适合观察。同样,也可以选择监控指定进程的数据

监控Disk I/O

queue(默认)的数值代表等待I/O队列长度,reads、writes分别代表每秒处理的读/写次数,readbytes、writebytes顾名思义,代表每秒读/写的数据量,单位同样在Metric Unit区域配置,通常Mb会比较适合观察。如果有挂载多个存储设备,可以在Filesystem Filter区域指定要监控的设备

 

windows下的资源监控1---jconsole

jdk目录下面有自带的资源监控平台--jconsole.exe

双击jconsole.exe,启动监控平台,可以选择需要监控的服务。可以是本地的tomcat进程,也可以是远程的服务器。这里我选择了监控jmeter进程。

在上方的概览中,我们可以看到堆内存,线程,类,cpu四个监控模块。时间可以自由选择。

在内存选项中,我们可以选择分别监控新生代,老年代,eden,space这些堆内存空间。同时可以手动gc内存。

在线程中,我们可以监控所有已加载的线程,同时一键检测线程死锁。

在类中,我们可以直观的看到各种性能数据。包括jmeter分配的线程池大小。

 

windows下的资源监控2---jmc工具,可以监控本地和远程机器

jmc的功能类似于jconsole,不过仪表盘式的外观和色彩看起来更加漂亮。

在底部的按钮可以针对堆内存,cpu,线程等进行性能诊断

windows下的资源监控2---jvisualvm工具,可以监控本地和远程机器

 

 

jvisualvm的功能更加强大一些,除了常规的数据监控之外,还可以对线程进行dump(只能针对本地,不能对远程服务进行dump

 

jdk自带的监控工具是丰富多彩的,我们可以根据自己的需求去选择不同的工具。

 

内存瓶颈分析

内存资源成为系统性能的瓶颈的征兆 :

  • 很高的换页率 (high pageout rate);

  • 进程进入不活动状态 ;

  • 交换区所有磁盘的活动次数可高 ;

  • 可高的全局系统 CPU 利用率 ; 

  • 内存不够出错 (out of memory errors)

 

cpu瓶颈分析

CPU 资源成为系统性能的瓶颈的征兆 : 

  • 很慢的响应时间 (slow response time) 

  • CPU 空闲时间为零 (zero percent idle CPU) 

  • 过高的用户占用 CPU 时间 (high percent user CPU) 

  • 过高的系统占用 CPU 时间 (high percent system CPU) 

  • 长时间的有很长的运行进程队列 (large run queue size sustained over time)

Guess you like

Origin www.cnblogs.com/Zfc-Cjk/p/10945572.html