0
votes

Jmeter 5.1.1 running on AWS EC2 windows box and also Server Agent 2.2.3. and added jp@gc - PerfMon Metrics Collector to collect the EC2 machine CPU Utilization, Memory, and Network I/O metrics and in PerfMon Metrics Collector plugin I have provided the EC2 instance Public IP and server agent port 4444. After running the script for the single thread I am getting java.net.connectException Connection timed out: connect. [jp@gc - PerfMon Metrics Collector- java.net.connectexception][1] [1]: https://i.stack.imgur.com/VIiIi.png

I also tried with providing the Private IP and port 4444, After running the script Server Agent gets closed immediately and I have received error java.net.SocketException: Connection reset by peer: socket write error.

on EC2 instance I have edited the inbound rule and opened port like this
All TCP TCP 0 - 65535 0.0.0.0/0

  • Jmeter Console log

    `*java.net.SocketException: Connection reset by peer: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_211]
        at java.net.SocketOutputStream.socketWrite(Unknown Source) ~[?:1.8.0_211]
        at java.net.SocketOutputStream.write(Unknown Source) ~[?:1.8.0_211]
        at kg.apc.perfmon.client.StreamTransport.writeln(StreamTransport.java:50) ~[perfmon-2.2.2.jar:?]
        at kg.apc.perfmon.client.AbstractTransport.disconnect(AbstractTransport.java:63) [perfmon-2.2.2.jar:?]
        at kg.apc.jmeter.perfmon.NewAgentConnector.disconnect(NewAgentConnector.java:36) [jmeter-plugins-perfmon-2.1.jar:?] at kg.apc.jmeter.perfmon.PerfMonCollector.shutdownConnectors(PerfMonCollector.java:281) [jmeter-plugins-perfmon-2.1.jar:?]  at kg.apc.jmeter.perfmon.PerfMonCollector.testEnded(PerfMonCollector.java:149) [jmeter-plugins-perfmon-2.1.jar:?]   at org.apache.jmeter.reporters.ResultCollector.testEnded(ResultCollector.java:346) [ApacheJMeter_core.jar:5.1.1 r1855137]   at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfEnd(StandardJMeterEngine.java:218) [ApacheJMeter_core.jar:5.1.1 r1855137] at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:492) [ApacheJMeter_core.jar:5.1.1 r1855137] at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]*
    

    i did telnet privateip:4444 and passed the test command. The server Agent returned the yep data.This set up is working on local box. Not on AWS box.
    Please let me know what will be the issue?

1

1 Answers

0
votes
  1. If you run Server Agent and JMeter on the same machine just use localhost

  2. You may need to open the port 4444 in Windows Firewall

  3. You may need to to set java.net.preferIPv4Stack property to true in case if Server Agent is bound to the IPv6 address

  4. It should be sufficient to open only one port in the Security Groups like:

    enter image description here

    also there is a difference between EC2 security groups and VPC security groups make sure to use the right one

More information: How to Monitor Your Server Health & Performance During a JMeter Load Test