Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] A decentralize Mosquitto cluster design.

Hi Jianhui

@Oegma2, I have tested your scenario in 3 brokers mosquitto cluster by Tsung, include 100 clients connected with will msg, and another client subscribed with topic filter "#", and found that only 25 will msgs received by the subscriber, so I have checked the mosquitto.log and found that the subscription was happend AFTER 75 clients' disconnection, so it only receive 25 will msgs for remained disconnection. Could you check with this point in your env.?
I've setup two clustered servers yesterday using t2.micro EC2 instances on AWS using the new LB (TCP edition) and got 2000 clients connected without any issues - got my LWT message on the subscriber side using mqttspy and sending a ping message to all 2000, i got pong 2000 message back with my details. I did remove a lot of the config's "YES" parts..like not doing any persistence or TLS or any special options 

In short, using the clustered mosquitto - and correct sub client tool "mqttspy" - things looking much better in terms of testing setup

Setup that I've tested yesterday (AWS Region eu-west-1):
   2x EC2 t2.micro instances running mosquitto on Ubuntu 16.04
   1x ELB (new edition TCP) forwarding traffic to both EC2 servers
   Route53 DNS mapping to the ELB 

Testing setup on my end - running in South Africa "very long distance from eu-west-1 :)"
   Client code on my side update to point to new DNS Route53 
   Spawned 2000 of those clients each doing the following steps
      1. Connection contains "LWT part when client goes offline"
      2. OnConnect -> Pub message to topic "STATUS" as online
      3. Sub -> Test/PingMe 
    Used mqtt-spy-1.0.0.jar as "worker" or subscriber to topic "#"

Using that setup
  1. Got 2000 message on topic "STATUS"
  2. When I close my loadtest, got 2000 LWT responses 
  3. Restarted clients and publish message to Test/PingMe ...got 2000 message back ;)

"I have' started to map metric in terms of msg/sec yet} - first trying to establish a working baseline" 

Next test will be to setup 3 clustered mosquitto and try 3000 clients with the same scenario 

Summary:
   * Working 2xmosquitto cluster with 2000 clients - everything working, including LWT
   * Suggest using mqtt-spy-1.0.0 as subscriber on topic "#"



On Sat, Jan 20, 2018 at 4:12 PM, jianhui zhan <hui6075@xxxxxxxxxxx> wrote:

@Tatsuzo Osawa, thanks for the information about share subscription, I would like to make the adaption for cluster if it is implemented on current Mosquitto. For the 60K clients limitation, maybe you can try to allocate more ip address to your NIC and bind the "clients'" socket with them.

@Oegma2, I have tested your scenario in 3 brokers mosquitto cluster by Tsung, include 100 clients connected with will msg, and another client subscribed with topic filter "#", and found that only 25 will msgs received by the subscriber, so I have checked the mosquitto.log and found that the subscription was happend AFTER 75 clients' disconnection, so it only receive 25 will msgs for remained disconnection. Could you check with this point in your env.?


From: mosquitto-dev-bounces@eclipse.org <mosquitto-dev-bounces@eclipse.org> on behalf of Tatsuzo Osawa <tatsuzo.osawa@xxxxxxxxx>
Sent: Saturday, January 20, 2018 7:11:55 AM

To: General development discussions for the mosquitto project
Subject: Re: [mosquitto-dev] A decentralize Mosquitto cluster design.
 
Hi Jianhui, Izak

Subscribing "#" is an interesting scenario, because a lot of IoT use cases consist one subscriber handles many publishers. But, under this cluster design, I think the idea of shared subscription in MQTTv5 becomes essential. I'd like to implement the shared subscription not only on MQTTv5 but also on current MQTT version as non-standard features of mosquitto in the near future.  

Regards,
Tatsuzo 
 

2018-01-20 0:19 GMT+09:00 jianhui zhan <hui6075@xxxxxxxxxxx>:

Hi Smit,


Thank you very very much for the testing, I have not tested with "#" which will bring a substantial messages forwarding inside the cluster. There's a traffic flow control for each client, and in the cluster implementation, the bandwidth of the pipeline between different brokers is the same as each broker with it's client, no special optimization. Is there any notice with "dropped" in the mosquitto log file if you enabled mosquitto.conf with log_type notice? 

And could you do the same test for mosquitto bridge mode? Because bridge also has a such kind of traffic flow control.


Anyway, I will try to simulate a high latency network and try to reproduce the scenario!


BRs,

Jianhui


From: mosquitto-dev-bounces@eclipse.org <mosquitto-dev-bounces@eclipse.org> on behalf of Oegma2 <oegma2@xxxxxxxxx>
Sent: Friday, January 19, 2018 23:11
To: General development discussions for the mosquitto project
Subject: Re: [mosquitto-dev] A decentralize Mosquitto cluster design.
 
I've repeated this test now 3x using old setup and cluster - think I will need to do some more testing first! So try the above but this is not yet 100% confined the results valid 

Will continue to see if I can get to a better answer for everybody - for now, just take note of my testing setup - and ignore the results - possible that my sub client or even network playing a role here.

On Fri, Jan 19, 2018 at 4:39 PM, Oegma2 <oegma2@xxxxxxxxx> wrote:
Hi everybody

I've done a very basic test - used my baseline setup as starting point to qualify that the system is working - so taking out any network, setup ext before switch over to the new mosquitto clustered option. Very basic test - 2 servers running mosquitto behind LB and 1000 client connection to the LB, splitting the load 50%/50% with one subscriber listening for all messages using "#"

The client all connect but the subscriber fails to receive the published online message from the clients. So each client starts up will inform mosquitto it will be using LWT & once connected, publish an online message

Only received about 280 connected message out of the 1000....small test that showing some problem somewhere. Using a more real world scenario where network latency will play a role and the clients & subscriber for message maybe on a different network

So the setup is simple:
  * 2xServers running mosquitto on private network on AWS using t2.micro EC2 instance
  * Using latest AWS LB (TCP option) forwardnig to those to EC2 instances
  * Then running my 1000 client from my own network in office to sim clients out in the field - so not running them in AWS 
  * To make thing more handy - running the subscriber client on different laptop in the office

The above scenario pass my normal setup using 2 subscribers to mosquitto and 1000 clients - I get all my connected messages and can also push message to all clients with no issue - so not the EC2 or LB or network in our around AWS/OFfice
Switching then to mosquitto cluster and do the same test, I can only get about 1/4 of the message & pushing message fails to get them...i have to send a lot of pub message to trigger the client to respond. . . but I never get the result on the subscriber side

Hope this helps and provide some idea where problem may be - - - but setup should be clients & workers/sub not in the same network as the broker and see if you can replicate this issue
(Or maybe my testing is flawed :))...but this is a real world scenario ..the clients and sub can be on different networks with latency but should not stop the system from working

Warm regards
Izak S Smit (Oegma)

On Wed, Jan 17, 2018 at 4:08 PM, jianhui zhan <hui6075@xxxxxxxxxxx> wrote:

Hi tatsuzo,


I have made a simple test for the cluster, use krylovsk/mqtt-benchmark as a benchmark tool. But with number of brokers increase to 3, the mean throughput get the limitation. I think the reason is that the client cannot offer enough stress to cluster. See appendix for detail.

It is not easy to test a cluster, especially for MQTT service, Tsung and Jmeter support client clustered, but they are not friendly for MQTT..

Anyway, I'll do more tests, and hope someone can also give a test for mosquitto cluster .. thanks!


BRs,

Jianhui


Appendix:

No. brokers 1 2 3 4 9
n10k c100 17548.83 25509.4 28878.05 28610.25 28947.78
n1k c1k 9928.573 16533.82 24105.12 24034.03 24328.37

Unit: Total Bandwidth (msg/sec), QoS=2, MsgSize=1000bytes.




From: mosquitto-dev-bounces@eclipse.org <mosquitto-dev-bounces@eclipse.org> on behalf of Tatsuzo Osawa <tatsuzo.osawa@xxxxxxxxx>
Sent: Wednesday, January 17, 2018 20:20
To: General development discussions for the mosquitto project
Subject: Re: [mosquitto-dev] A decentralize Mosquitto cluster design.
 
Hi Oegma,
cc Jianhui

> Will it even make sense to try this - get server with 16 CPU's and run 8 brokers on single box....? Normal Mosquitto
> is only using a single CPU at time - with this option you can already use one server with more CPU's to handle the 
> traffic/load ...

I think applying the cluster on multicore environment might be a cool idea.
Because, as you described, normal mosquitto cannot use multicore efficiently.

Regards,
Tatsuzo



_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev



_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mosquitto-dev



Back to the top