vernemq / vmq_mzbench

An MQTT loadtest and usage scenario tool for VerneMQ and other MQTT systems.
Apache License 2.0
42 stars 44 forks source link

mzbench not connecting to the host specify in the scenario #26

Closed shaloba closed 4 years ago

shaloba commented 6 years ago

Hi,

I have cloned the repository https://github.com/machinezone/mzbench.git in order to stress test my VerneMQ broker. I use the following scenario that uses this repository mqtt_worker

#!benchDL

#######
# Scenario:
# A single subscriber reading from "prefix/clients/#" topic filter
# 1k publisher publishing to exclusive topic "prefix/clients/{client_id}"
# Overall msg rate: 1k msg/s
# Message size: 150 random bytes
# Running time: 5 min
#######

make_install(git = "https://github.com/erlio/vmq_mzbench.git",
             branch = "master")

pool(size = 1,
     worker_type = mqtt_worker):
        connect([t(host, "dev-csp.dc.dojo-labs.com"),
                t(port,1883),
                t(client,"subscriber1"),
                t(clean_session,false),
                t(keepalive_interval,60),
                t(proto_version,4), t(reconnect_timeout,4)
                ])

        wait(60 sec)
        subscribe("prefix/clients/#", 0)

when i run the scenario above I noticed that its not connecting to the host i'm specifying, can you please tell me if im doing something wrong here ?

Thanks in advanced! :)

Shlomy.

larshesel commented 6 years ago

What errors do you see? Have you made sure with another client like mosquitto_pub that you're able to connect to the broker as expected?

shaloba commented 6 years ago

Hi, I do not see any errors, I'm used python client (with Eclips paho library) in order to verify the broker is running without issue and I saw the python client connected to the broker but didn't saw the MZbench client. One more weird thing is that i changed the port from 1883 to 18883 (no service listing to that port) and the script didn't raise any connection errors.

The MZbench server is running via Docker (used the DockerFile to build and run it)

I'm attaching the run log (hope it will be helpful)

with the current port (1883) log.txt

with the in-current port (18883) log2.txt

ioolkos commented 6 years ago

I guess the script you posted above is incomplete. From the log it seems you connect 1k publishers and send messages, but you don't have a consumer for those. Please adapt the wait(1 sec) to 5 seconds or so, in the consumer pool. (everything is async, the subscribe might be wrongly timed)

shaloba commented 6 years ago

Hi, thanks for the reply. sorry the scenario didn't match to the logs, I'm changing the wait to 10 sec and will check

shaloba commented 6 years ago

still no success :/

I have attached the log to the updated scenario

with the current port (1883) log.txt

with the incurrect port (18883) log2.txt

ioolkos commented 6 years ago

Can you please post the whole script, as you are trying to run? (anonymising IPs)

shaloba commented 6 years ago

@ioolkos , what you mean by the "whole script" ? I ran the following scenario using MZBench GUI

#!benchDL

#######
# Scenario:
# A single subscriber reading from "prefix/clients/#" topic filter
# 1k publisher publishing to exclusive topic "prefix/clients/{client_id}"
# Overall msg rate: 1k msg/s
# Message size: 150 random bytes
# Running time: 5 min
#######

make_install(git = "https://github.com/erlio/vmq_mzbench.git",
             branch = "master")

pool(size = 1,
     worker_type = mqtt_worker):
        connect([t(host, "dev-csp.dc.dojo-labs.com"),
                t(port,18883),
                t(client,"subscriber1"),
                t(clean_session,false),
                t(keepalive_interval,60),
                t(proto_version,4), t(reconnect_timeout,4)
                ])

        wait(60 sec)
        subscribe("prefix/clients/#", 0)
ioolkos commented 6 years ago

OK, my misunderstanding. So it's a script that just connects 1 subscriber. (60 sec wait time is too high btw)

Normally you'd run a whole test scenario, connecting some publishers and send some messages. Otherwise MZBench can't measure latencies etc.

shaloba commented 6 years ago

I ran the whole test in the first but I didn't see any activity in my broker (traffic) nor the client ID in the broker clients list . so i started to mess around with the script (change the domain or the port ) I assumed that the test will fail because there is not service that listing to the port I set. I'm very confuse regarding this mqtt_worker because one of the connect function parameters is the host

ioolkos commented 6 years ago

Don't let things confuse you. An MQTT listener is exposed on an IP and a port. If you want to connect from an MQTT client, you have to provide the IP and the port. There is no point in experimenting with ports that are not configured. The reason you did not see traffic was that the consumer wasn't subscribed due to a timing issue, therefore you published messages but did not received them.

Try to make a simple script run in MZBench, then take it from there, increasing number of publishers, etc.

ioolkos commented 6 years ago

@shaloba did the suggested approach work better? hope so.. ;)