JMeter Client/Server Remote Testing on Docker

Introduction

It summarizes the settings when using Client and multiple Servers using multiple VMs of JMeter. It is for people (self) who did not move properly with the information (*) that hits the top even if it goes around.

** Environment you want to run **
image.png

Conclusion

Run Server

Start JMeter Sever


sudo docker run -it --rm \
     -p20000:20000 \
     justb4/jmeter:latest \
     -s -n -j /dev/stdout \
     -Dserver_port=20000 -Dserver.rmi.localport=20000 \
     -Dserver.rmi.ssl.disable=true \
     -Djava.rmi.server.hostname=$(host $(hostname)| awk '{print $4}') \
     -Jmode=Statistical

--Specify the port to be used with server_port, server.rmi.localport, and open the port with -p20000: 20000. --server.rmi.ssl.disable = true does not use SSL, so disable it. --In java.rmi.server.hostname, the IP of the host is attached from Client, so embed the IP of the host with$ (host $ (hostname) | awk'{print $ 4}'). --Since there is a lot of communication between Cleint <-> Servers (thousands of qps or more), use Statistical to reduce the amount of communication.

Launch Client

Start JMeter Client


sudo docker run -it --rm \
     -v $(pwd):/script -p20001:20001 -p20002:20002 -p20003:20003 \
     justb4/jmeter:latest \
     -Dserver.rmi.ssl.disable=true  \
     -Djava.rmi.server.hostname=$(host $(hostname)| awk '{print $4}') \
     -Dclient.rmi.localport=20001 \
     -Jremote_hosts=server-1:20000,server-2:20000,.... -Jmode=Statistical \
     -t /script/1.jmx -n -l /script/test.jtl -e -r -X

--Fixed port number with client.rmi.localport = 20001. Since a maximum of three are used, open the port with -p20001: 20001 -p20002: 20002 -p20003: 20003. --server.rmi.ssl.disable = true does not use SSL, so disable it. --In java.rmi.server.hostname, the IP of the host is attached from Client, so embed the IP of the host with$ (host $ (hostname) | awk'{print $ 4}'). --Specify a remote server with remote_hosts. ---t to specify the script file and -l to specify the result file.

Addictive point

Error sending data to Server-> Client

2020-12-21 12:04:39,730 ERROR o.a.j.t.RemoteThreadsListenerWrapper: Exception invoking listener on threadStarted.
java.rmi.ConnectException: Connection refused to host: xxx.xxx.xxx.xxx; nested exception is:
	java.net.ConnectException: Connection refused (Connection refused)

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. https://jmeter.apache.org/usermanual/remote-test.html#tips

I think there are many cases where the port number is fixed using client.rmi.localport. However, ** the maximum number of ports used is 3 ports. ** (20001 ~ 20003 in this example) I'm addicted to the fact that there aren't many articles that describe this ...

Motivation

It's a story about why I tried to run it with JMeter + Docker.

We also use various stress tools such as JMeter, Gatling, WRK, Vegenta. Older ones have stress testing scenarios in JMeter. It's annoying to write again with another tool such as Gatling. However, the execution environment of JMeter does not exist in the first place. And for some reason, the server is in charge of another department, and it is troublesome to request Java installation.

My motive is that I want to move it quickly with Docker.

"Huh? I've been addicted to this before ..." I recorded it for myself as well.

Recommended Posts

JMeter Client/Server Remote Testing on Docker
Liberty on Docker
Redmine on Docker
Docker installation on CentOS 6
python notes on docker
Install Docker on Manjaro
M.S. docker on Windows
Docker installation on WSL2
Run phpunit on Docker
Docker login not possible on remote Mac (Error saving credentials)
Install Docker on Raspberry Pi
Install Docker on Windows 10 PRO
Run VS Code on Docker
Run openvpn on Docker (windows)
Try Docker on Windows 10 Home
Oracle Java 8 on Docker Ubuntu
Hosted Apicurio Studio on Docker
Install docker on AWS EC2
Install Docker on Ubuntu and set up remote connection using tls