1

I am using Jmeter with MQTT JMeter Plugin to do loading test.

Here is my use cas:

  • Started 8000 users(threads) during 30 minutes
  • Each user do one mqtt connect message
  • Each user do 720 loops to publish a message with 5 seconds timer

Here is my jmeter test plan

enter image description here

My threads

enter image description here

My loop controller:

enter image description here

My timer:

enter image description here

After starting Jmeter, every thing is good:

But after 20 minutes, i am getting many errors for my pub messags:

Here is the error message:

enter image description here

My mqtt server is up and no pb with it.

Jmeter logs:

Aug 01, 2021 3:04:33 PM java.util.Optional ifPresent
INFO: MQTT client is not connected.

Aug 01, 2021 3:04:33 PM net.xmeter.samplers.PubSampler sample
INFO: ** [clientId: ps303411a2200c4e1ca4f34, topic: /test/, payload: 1627830273593ts Publish failed for connection HiveMQTTConnection{clientId='ps303411a2200c4e1ca4f34'}.

Aug 01, 2021 3:04:33 PM java.util.Optional ifPresent
INFO: MQTT client is not connected.

What is the pb ? is this related to Jmeter test plan ? or to my local machine ? i am using EC2 x3 large machine to start Jmeter in background.

karlos
  • 807
  • 1
  • 8
  • 38

2 Answers2

0

since your ramp up period is 1800 sec, you have nearly 5.6k threads at 20th minute where, i think your server starts to saturate. The 501 return code may indicate that some kind of fallback mechanism can give more details about the error, but not sure...

Kemal Kaplan
  • 932
  • 8
  • 21
  • I increased ramp up period to 3600 and i am waiting the result. Can you tell me please what debug can i do to know the source exact of pb ?. NB of TCP connectins ? memory ?. What about mqtt server ?, nothing i am seeing in the logs. – karlos Aug 01 '21 at 14:27
  • Now the server should saturate near 40th minute. There are some parameters for adjusting the connection limits for HiveMq (https://www.hivemq.com/docs/hivemq/4.6/user-guide/restrictions.html) and you may also want to check the OS limits ( i.e ulimit etc.) – Kemal Kaplan Aug 01 '21 at 15:54
  • Ulimit in server side (borker) or client (jmeter) ?. What about other OS limits (thier names pls ) ? Thanks – karlos Aug 01 '21 at 18:57
  • Jmeter successfully creates the connection, which means the limit should be on the server side. The OS limits depends on the OS type. SO and ServerFault has very useful topics about these limits.. – Kemal Kaplan Aug 01 '21 at 19:15
0

MQTT client is not connected.

It indicates that the connection is down, if you don't see anything suspicious in JMeter logs - most probably it means that your server gets overloaded and cannot handle that many concurrent connections/messages.

  1. Use a combination of listeners like Active Threads Over Time and Response Codes per Second to see what is exact number of users where the problems start occurring

  2. Monitor resources usage like CPU, RAM, Network sockets, Disk IO, etc. to ensure that the MQTT server has enough space to operate, you can use JMeter PerfMon Plugin for this

  3. Check your server logs

  4. Increase JMeter logging verbosity for the MQTT plugin by adding the next line to log4j2.xml file:

    <Logger name="net.xmeter" level="debug" />
    
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Very simple to disprove: open another client from a different machine. If it connects and works, open another, etc. Here is a methodology to make sure your test rig is not the bottleneck: https://gambitcomm.blogspot.com/2016/10/mqtt-performance-methodology-using.html – Gambit Support Aug 02 '21 at 11:08