PerfMon-JMeter Server Monitoring PlugIn

In this article we are going to see what are additional features/items added after installing jmeter plugin (Google Plugin) and what we can do with it. I will discuses about Listeners only. To know about basic of jmeter see my this page. And, the process to install plug in , see this post.

What is PerfMon plugins? It is a server monitor plugin , where we can check the health of the server from jmeter while running. The supported list is here. And we can test on web server that we are generating load on as well as remote servers where our remote agents are running.
So, by the objective of the plug in, we clearly understand there will be two component. One is, jmeter listener which will be running with jmeter. And another one will be on the server, which will send info to jmeter listener about the server.
From this download link, download server plugins(currently version 2.2.1), and install plugins to jemter.

-After download the server agent on server, and run startAgent.bat in windows or startAgent.sh in Linux server. It will open UDP/TCP server ports where jmeter will communicate.

-Now, we have to add jp@gc - PerfMon Metrics Collector  this listener in our jmeter test plan. (controller PC, where we are running jmeter)

-Select jp@gc - PerfMon Metrics Collector and click add a row
-In a row, we have to add server IP/address( where the server agent is present),Port number, the information that we want (CPU/memory) from a selectable comb and a metric parameter. So, here is a generic screenshot.

So, now we can run, our test and see the log file. I have used a sample dummy sampler(not real test) to get some viewable report.
Running screen shot1
Running screen shot2


Metric parameter:
Metric parameter are sub type or options under main metric controller. It is basically a string constructor that goes as parameter. It helps for making understandable metrics as well as helps to get specific info that we need. So, for Nine type of metric controllers we have nine metric parameters. Screenshots are here.
1. Metric parameter-CPU
2. Metric parameter-Memory
3. Metric parameter-Disk IO 
4. Metric parameter-Network IO
5. Metric parameter-Swap 
6. Metric parameter-TCP
7. Metric parameter-JMX 
8. Metric parameter-EXEC
9. Metric parameter-TAIL

Agent Tweaking :
1. We can enable or disable any port by shell command. Port 0 for disabled. We have to run our startAgent.sh/bat in following manner 
Syntax : $ ./startAgent.sh --<ProtocallPort> <port number>
Ex : To enable UDP at port 5000 : we need to run this in command prompt.
$ ./startAgent.sh --udp-port 5000
Or, to disable TCP port
$ ./startAgent.sh --tco-port 0

2. We can Auto Shutdown agent after test completion
Syntax : $ ./startAgent.sh --<ProtocallPort> <port number> --auto-shoutdown
 EX- $ ./startAgent.sh --udp-port 5000 --auto-shutdown

3. We can use system Info showing for system object while running, 
$ ./startAgent.sh --sysinfo

Notes : 
-No Need Admin privilege in the server
-Server agent needs JRE 1.4+ version. So, you need that installed in server.(or you can add jre package inside the folder. In that case, you have to edit bat file)
-We can use multiple servers. To do that , multiple server should have the agent.

Agent Extension : Following this interface kg.apc.perfmon.client.Transport , we can use this plug in for other software using, like custom performance monitor. I will make a separate post on how can we make a class on JAVA to use this plugin for getting information.

Thanks...:)...

15 comments:

  1. I followed the same steps and I need to be on VPN to connect to the server so when i connect and run the server agent on the server and then run my jmeter from my machine i get error as below:

    ERROR: java.net.ConnectException: Connection timed out: connect

    Do you why this is happening?Do i need to change any property file or any other config file?

    ReplyDelete
    Replies
    1. have you properly set up RMI registry? The exception shows connection problem because of timeout. I think , because of VPN, you cant access PC via jmeter default configuration. Send me detail exception and steps, i might can help to configure your jmeter to support properly.

      Delete
    2. Hello, you managed to solve the problem? If so can you provide the solution please? I have the same problem. I succeed to doing telnet on the server (RedHat), I succeed doing the test with JMeter with the agent in my local machine. But I am getting "ERROR: java.io.IOException: Agent is unreachable via TCP" doing the test with JMeter in my local machine and the agent on the server (RedHat). I think is it because of VPN

      Delete
    3. Hello, Normally you get the error "ERROR: java.io.IOException:" when there is no JRE in the server...Please make sure you have java runtime environment in the server machine as well...then you won't get there errors.!!

      Delete
    4. Hi Anthony, thank you for your answer. Unfortunately didn't work. As I said before I'm able to telnet from my machine to the server. But when I try do it with Jmeter I'm getting this error: "ERROR: java.io.IOException: Agent is unreachable via TCP". In serverAgent on the server I'm getting :
      INFO 2014-06-25 23:41:53.156 [kg.apc.p] (): Yep, we received the 'test' command
      INFO 2014-06-25 23:41:53.586 [kg.apc.p] (): Closing TCP connection
      This is strange because the connection is establish but soon after it is closed.
      My guess is it because VPN. I think is needed change some jmeter properties in jmeter.properties file to work with VPN but I don't know what to change. Can you help me?

      Delete
  2. Awesome Artical Really i have searching this type of valuable information From a lot of days i found satisfaction when Read your blog Thanks for giving this type blog and also please Read link bvba Woodstone which provide information server monitoring & monitoring tools

    ReplyDelete
  3. I'm using distributed testing meachanism using Jmeter. I'm running scripts on server, but script execution is taking place from local computer[using Remote Server option].

    Test Environment will like this,

    Scripts Triggering machine, from which script will be executed
    Load Balancer Node - Distribute the load on all the 5 servers.
    Server1
    Server2
    Server3
    Server4
    Server5

    Where should I run the server agent on the above setup? Is it on all the server nodes 1-5?


    ReplyDelete
    Replies
    1. you need to run on the servers that you want to monitor.
      That means, if you are application server , run agent in application server.
      if you monitor jmeter slave servers, run agent in that server.

      Delete
  4. We are using distributed mechanism for the performance tests using JMeter. We have plenty of automated scripts created to verify the performance of the application.

    Test Environment is configured like below,

    Scripts triggering Machine - used to run the scripts on the remote servers mentioned below.
    Load Balancer Server
    Server1
    Server2
    Server3
    Server4

    Where should i install server agent to monitor the performance of the servers[1-4]?

    ReplyDelete
  5. Thanks. Should I need to run the server agent on Server1, Server2, Server3, Server4 to get the performance metrics?

    ReplyDelete
    Replies
    1. if you intent to monitor them , yes..

      Delete
  6. What setting do i need to change in jmeter.property ?

    I am getting Error :
    2016/04/28 12:38:30 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
    2016/04/28 12:38:30 INFO - kg.apc.jmeter.perfmon.PerfMonCollector: PerfMon metrics will be stored in C:\Users\snarayan\AppData\Local\Temp\perfmon_8231788921020883151.jtl
    2016/04/28 12:38:30 INFO - kg.apc.jmeter.perfmon.PerfMonCollector: Can't connect TCP transport for host: /10.152.172.176:4449 java.io.IOException: Agent is unreachable via TCP
    at kg.apc.jmeter.perfmon.PerfMonCollector.getConnector(PerfMonCollector.java:245)
    at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnector(PerfMonCollector.java:228)
    at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnectors(PerfMonCollector.java:180)
    at kg.apc.jmeter.perfmon.PerfMonCollector.testStarted(PerfMonCollector.java:133)
    at org.apache.jmeter.reporters.ResultCollector.testStarted(ResultCollector.java:283)
    at kg.apc.jmeter.vizualizers.CorrectedResultCollector.testStarted(CorrectedResultCollector.java:28)
    at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:209)
    at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:325)
    at java.lang.Thread.run(Unknown Source)

    4449 port is open and i can connect it using telnet.
    not sure what the problem is .. can u help

    ReplyDelete
    Replies
    1. Problem is -> Agent is unreachable via TCP to 10.152.172.176:4449

      Your setup was wrong for RMI. Setup RMI properly. your Jmeter cant connect perfmon agent.

      Delete