mqttjs / MQTT.js

The MQTT client for Node.js and the browser
Other
8.61k stars 1.42k forks source link

Poor performance when publishing #1899

Closed RickBullotta closed 4 months ago

RickBullotta commented 4 months ago

MQTTjs Version

5.8.0

Broker

HiveMQ 4

Environment

NodeJS

Description

When publishing approximately 5000 topics (each a small JSON payload with the retain flag set), I'm only seeing throughput of about 72 messages per second. That seems extremely low. Oddly enough, when connected to a cloud instance of HiveMQ versus a local instance, the throughput is excellent. I suspect some type of handshaking or network buffer flushing is causing this regression.

Minimal Reproduction

Publish 5000 messages quickly. Monitor HiveMQ's inbound/outbound message rates.

Debug logs

Not applicable.

robertsLando commented 4 months ago

@RickBullotta Could you tell me if this is a regression and if yes point me to the version that introduced this?

Are you able to reproduce this with other brokers?

RickBullotta commented 4 months ago

It turns out that it was a regression/flow control issue in the broker. Closing issue.