Home > OS >  Facing issue while runningj ustb4/jmeterwith docker -- I am trying to run jmeter container with anot
Facing issue while runningj ustb4/jmeterwith docker -- I am trying to run jmeter container with anot

Time:04-30

Facing an issue while running justb4/jmeter with docker -- I am trying to run jmeter container with another container localhost:55001 in the windows system

I have two container --one container with localhost:55001 --another container with justb4/jmeter

Now I am trying to run justb4/jmeter jmx file, which in my local docker run -d -p 8081:88 --network="HSM" --mount type=bind,source="/D/D_Backup/Jmeter/apache-jmeter-5.2.1/bin",target="/opt/apache-jmeter-5.4.3/bin" justb4/jmeter -n -t bin/.jmx -l bin/NextGen_HSM_Run.jtl -e -o bin/h.html

Getting below error 1651205770221,39,GetConnectionStatus_1,Non HTTP response code: org.apache.http.conn.HttpHostConnectException,Non HTTP response message: Connect to localhost:55001 [localhost/127.0.0.1] failed: Connection refused (Connection refused),HSM.GetConnectionStatus.Thread 2-1,text,false,Test failed: code expected to contain /200/,2647,0,1,2,http://localhost:55001/GetConnectionStatus,0,0,39

But when I am running from JMeter all transactions are passing.

CodePudding user response:

If you want to use justb4/jmeter for testing another application in another container you need to use not localhost in JMeter but the IP address of the container where the application is running.

So you need to obtain the IP of the "other" container with something running on port 55001 using docker inspect command and replace localhost with the IP address of that container in the test plan.

More information: Networking with standalone containers


Just in case I truly hope you know what you're doing because running JMeter and the application under test on the same machine, especially virtual, especially a Docker one is the worst approach for assessing the performance as JMeter might be very resource intensive as well as the system under load so you will have hard time analyzing the results due to race conditions so I would recommend reconsidering your test lab setup or at least using software like cAdvisor or JMeter PerfMon Plugin to monitor resources utilization.

However the best option would be having the system under test and JMeter on a different physical or at least virtual machines.

  • Related