NathanVss
NathanVss

Reputation: 644

JMeter port issue

I need to run JMeter in distributed mode behind a firewall, as far as I know JMeter requires 3 ports:

Here is how I run my servers

jmeter-server -Dserver.rmi.localport=50000 -Djava.rmi.server.hostname=<PUBLIC IP> -Jserver.rmi.ssl.disable=true

How I run the client

jmeter -n -t sample-test.jmx -l result.log -e -o /var/www/html/jmeter -Djava.rmi.server.hostname=<PUBLIC IP> -Dclient.rmi.localport=60000 -Jserver.rmi.ssl.disable=true -R<SERVER IPS>

When I run the client command the test gets executed on the servers well. But the servers seems to not be able to send any data back to the client, the client gets stuck WITHOUT printing those example lines when it works:

summary +      2 in 00:00:03 =    0.7/s Avg:   282 Min:   278 Max:   286 Err:     0 (0.00%) Active: 42 Started: 42 Finished: 0
summary +  20400 in 00:00:30 =  688.7/s Avg:   105 Min:   100 Max:   292 Err:     0 (0.00%) Active: 500 Started: 500 Finished: 0
summary =  20402 in 00:00:32 =  631.0/s Avg:   105 Min:   100 Max:   292 Err:     0 (0.00%)
summary +  34429 in 00:00:29 = 1192.6/s Avg:   104 Min:    99 Max:   271 Err:     0 (0.00%) Active: 0 Started: 500 Finished: 500
summary =  54831 in 00:01:01 =  895.8/s Avg:   105 Min:    99 Max:   292 Err:     0 (0.00%)
Tidying up remote @ Tue Jan 25 21:34:28 UTC 2022 (1643146468961)
... end of run

On the client side, I ran

lsof -i -P -n | grep LISTEN

which gives me

java      1267 root  131u  IPv4  78926      0t0  TCP *:60002 (LISTEN)
java      1267 root  132u  IPv4  78927      0t0  TCP *:60001 (LISTEN)

Which really surprise me I was expecting to only see the port 60000, I wasn't expecting at all to see two ports and none of them being 60000.

So, when I open the specific 60001,60002 ports on my firewall everything works well. But I really don't understand this behavior at all because everything I read about JMeter just tells to open ( in my case ) the port 60000 (1099,50000 too, but those work well ), it is never mentioned to open 60001,60002 ports ... I'm kind of lost.

Thanks.

Upvotes: 0

Views: 1420

Answers (2)

Dmitri T
Dmitri T

Reputation: 168002

As per Remote hosts and RMI configuration chapter of the JMeter Properties Reference:

client.rmi.localport - Parameter that controls the RMI ports used by RemoteSampleListenerImpl and RemoteThreadsListenerImpl (The Controller) Default value is 0, which means ports are randomly assigned. If this is non-zero, it will be used as the base for local port numbers for the client engine. At the moment JMeter will open up to three ports beginning with the port defined in this property.

You may need to open corresponding ports in the firewall on the Controller machine.

You may find JMeter Distributed Testing with Docker article useful as it explains all the RMI networking related stuff

Upvotes: 1

NathanVss
NathanVss

Reputation: 644

The only place I could find referring to my issue to:

https://bz.apache.org/bugzilla/show_bug.cgi?id=65028

This guy is right, tutorials don't talk about that and the documentation does not highlight this specific point.

This section tells "If this is non-zero, it will be used as the base for local port numbers for the client engine. At the moment JMeter will open up to three ports beginning with the port defined in client.rmi.localport. If there are any firewalls or other network filters between JMeter client and server, you will need to make sure that they are set up to allow the connections through. If necessary, use monitoring software to show what traffic is being generated."

https://jmeter.apache.org/usermanual/remote-test.html#tips

I read it too quickly.

Hope my problem could help some else ! :)

Upvotes: 0

Related Questions