Servers Performance Monitoring

Introduction

During a load test, it is important to know the health of the servers loaded. It is also nice to see if you are targeting a cluster if the load is correctly dispatched. To address this, the plugin package now supports server monitoring! Using it, you can monitor CPU, Memory, Swap, Disks I/O and Networks I/O on almost all platforms!

Here is how the plugin looks like. It shows the CPU usage of 4 servers involved in the load test:

Metrics Collected

Since version 0.5.0 the Server Agent tool supports collecting over 75 system metrics. See full list.

How it works

Concept

JMeter cannot retrieve by default server metrics except Tomcat ones. To overcome this situation, we have developed a server agent which will get performance data for JMeter. The agent uses the SIGAR open source library. It is composed of a Java common part and native libraries per OS.

Usage

GUI Mode

In GUI mode, just add the listener, define servers and metric types to monitor, ensure the agent is running at remote server and is not blocked by a firewall, then run the test. The values will be displayed at real time chart.

Non GUI Mode

If you run JMeter in non GUI mode and want to save monitoring data to file, just configure result file saving in GUI as you do with other listeners. After running the test you may load saved file into GUI and see the values timeline.

PerfMon Server Agent

Installation

You do not need any root/admin privilege. You can just unzip the the ServerAgent-X.X.X.zip somewhere on the server. Then launch the agent using startAgent.sh script on Unix, or startAgent.bat script on Windows.

The agent is written in Java, so you will need JRE 1.4+ to run it. Note you can create yourself the agent package which includes its own JRE so you don't have to install java on the server (We tested it on windows platform). To do this, just create a JRE folder in the agent folder and copy one installed JRE inside. Change the java command inside the .bat file to the path to the java executable and it will work.

Once the agent is running, you can use the PerfMon Metrics Collector Listener to connect to the agents. You can add multiple servers to monitor, one graph can display several kinds of metrics (cpu, memory, etc...), auto-zooming rows for best view.

Usage

To start the agent, simply run startAgent bat/sh file. It will open UDP/TCP server ports where JMeter will connect and query the metrics. Some information will be printed to standard output, informing you on problems gathering metrics (logging verbosity regulated with --loglevel parameter).


PerfMon Metrics Collector and Server Agent原理和使用可以查看官方文档

具体可以查看官方的文档: 
https://jmeter-plugins.org/wiki/PerfMon/

https://jmeter-plugins.org/wiki/PerfMonAgent/


下面对环境进行配置:

第一步:https://jmeter-plugins.org/wiki/PerfMonAgent/下载ServerAgent-2.2.1.zip,将ServerAgent-2.2.1.jar上传到被测服务器,解压可以直接运行 (Windows环境,双击ServerAgent.bat启动;linux环境执ServerAgent.sh启动,默认使用4444端口)

第二步:https://jmeter-plugins.org/downloads/old/下载JMeterPlugins-Standard-1.4.0.zip和JMeterPlugins-Extras-1.4.0.zip

PS:jmeter的plugin1.4.0的只支持jmeter3.2以下,不包括3.2!!! 
第三步:然后解压两个zip包,把jar文件拷贝到/lib/ext文件夹下,环境配置就完成了。

新建测试用的取样器,并在监听器选择jp@gc - PerfMon Metrics Collector和jp@gc - Transactions per Second两个监听器,ServerAgent默认是4444端口,也可以修改,比如:./startAgent.sh –udp-port 0 –tcp-port 3450这样

进行加压的结果


在压测性能过程中,有一点非常非常非常重要:

Non GUI Mode

If you run JMeter in non GUI mode and want to save monitoring data to file, just configure result file saving in GUI as you do with other listeners. After running the test you may load saved file into GUI and see the values timeline.

Non GUI Mode

If you run JMeter in non GUI mode and want to save monitoring data to file, just configure result file saving in GUI as you do with other listeners. After running the test you may load saved file into GUI and see the values timeline.

压测过程中一定要在 NON-GUI模式进行压测,这也是很多用JM的人经常忽略的地方,如果一个测试人员用JM压测性能的时候,还使用GUI模式压测,那么能够立马体现你的专业水平很low。

本篇文章只做GUI模式压测演示,需要查看如何进行NON-GUI模式进行,请查看小七前几篇文章。

 

随机推荐

  1. 如何用qq代理发送邮件

    今天我想写一篇服务器发送验证邮件的的文章,我查阅过其他博客里面写的文章,都是可以实现的,但是对于初学者来说是一个很痛苦的事情,很多代码看不懂,原因有多种,写的多,写的乱,然后就不想往下看了.我今天详细 ...

  2. python序列化模块json和pickle

    序列化相关 1. json 应用场景: json模块主要用于处理json格式的数据,可以将json格式的数据转化为python的字典,便于python处理,同时也可以将python的字典或列表等对象转 ...

  3. csdn在线编程里面的一个排列组合题

    是csdn在线编程里面的一个问题 回文字符串是指从左到右和从右到左相同的字符串,现给定一个仅由小写字母组成的字符串,你可以把它的字母重新排列,以形成不同的回文字符串. 输入:非空仅由小写字母组成的字符 ...

  4. C51 库函数(2)

    3.2 STDIO.H:一般I/O函数 C51编译器包含字符I/O函数,它们通过处理器的串行接口操作,为支持其它I/O机制,只需修改getkey()和putchar()函数,其它所有I/O支持函数依赖 ...

  5. N种方法妙讲LIS算法

    LIS算法经典汇总 假设存在一个序列d[1..9] = 2 1 5 3 6 4 8 9 7,可以看出来它的LIS长度为5.下面一步一步试着找出它.我们定义一个序列B,然后令 i = 1 to 9 逐个 ...

  6. 看Lucene源码必须知道的基本概念

    终于有时间总结点Lucene,虽然是大周末的,已经感觉是对自己的奖励,毕竟只是喜欢,现在的工作中用不到的.自己看源码比较快,看英文原著的技术书也很快.都和语言有很大关系.虽然咱的技术不敢说是部门第一的 ...

  7. Linux Java开发坏境搭建,Ubuntu-jdk+tomcat+eclipse+svn 包安装详细操作

    更新时间2015-03-15 更新2015-04-12 svn安装更新 第一步 安装jdk (在linux上使用yum安装JDK  http://blog.chinaunix.net/uid-1546 ...

  8. elasticsearch视频34季

    02_结构化搜索_在案例中实战使用term filter来搜索数据 课程大纲 1.根据用户ID.是否隐藏.帖子ID.发帖日期来搜索帖子 (1)插入一些测试帖子数据 POST /forum/articl ...

  9. Python 判断文件是否存在

    参考:https://www.cnblogs.com/jhao/p/7243043.html

  10. [转]dd命令、cp命令详解+dd命令、cp命令对比 ---delong

    出处:http://blog.csdn.net/sun_app/article/details/18263299 1.dd命令详解 1)中文man手册dd的解释 NAME       dd - 转换和 ...