You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current version of MQTTX, when running the Publish Benchmark, users can run the mqttx bench pub command and define various parameters such as the number of clients and topics. However, there is no way to limit the number of published messages. This can lead to uncontrolled message flow and potential system overload. Users may be frustrated by the lack of control over the number of messages they are publishing.
Detailed design
To resolve this issue, I propose the addition of a -L (--limit) parameter for the "mqttx bench pub" command. This parameter will allow users to set a maximum limit for the number of published messages. Here is how it would look:
Parameter
Description
Default
-L, --limit
The maximum number of messages to publish. A value of 0 means no limit on the number of messages.
0
If the --limit parameter is set to a value greater than 0, the command will publish up to the defined number of messages. If it's set to 0, there will be no limit to the number of messages published.
Example of use:
Command:
mqttx bench pub -c 5000 -t bench/%i -L 1000
Explanation: This command publishes data with MQTTX Bench where:
-c 5000 means that it uses 5000 clients,
-t bench/%i is the topic to which data is published,
-L 1000 limits the number of published messages to 1000.
Result:
The MQTTX Bench will publish up to 1000 messages to the topic bench/%i using 5000 clients. If the data to be published exceeds 1000 messages, it will stop sending further messages.
Alternatives
An alternative approach could be implementing a global setting for message limits that would apply to all "mqttx bench pub" commands. However, this would limit the flexibility of the command and may not be suitable for all use cases. Another alternative could be to ignore this feature, leading to issues with system overloads and reduced performance.
More detail (optional)
This feature requires modifications in how the "mqttx bench pub" command is implemented. It would need to consider the new --limit parameter and adjust the message publishing process accordingly.
Here's a simple flow diagram for better understanding:
Start -> Check if --limit > 0 -> If True, Limit the number of messages to --limit -> Continuously publish messages -> End
|
-> If False, No limit on the number of messages -> Continuously publish messages
This feature enhances the control users have over their message flow, providing a more efficient and manageable way of using MQTTX.
The text was updated successfully, but these errors were encountered:
ysfscream
changed the title
The CLI now has a -L parameter to limit message size.
[Feature] The CLI now has a -L parameter to limit message size.
Jul 17, 2023
ysfscream
changed the title
[Feature] The CLI now has a -L parameter to limit message size.
[Feature] The CLI adds a -L parameter to limit message size.
Jul 17, 2023
ysfscream
changed the title
[Feature] The CLI adds a -L parameter to limit message size.
[Feature] The CLI adds a -L parameter to limit message size in the bench command
Jul 17, 2023
Ref: https://github.com/emqx/emqtt-bench
Motivation
In the current version of MQTTX, when running the Publish Benchmark, users can run the
mqttx bench pub
command and define various parameters such as the number of clients and topics. However, there is no way to limit the number of published messages. This can lead to uncontrolled message flow and potential system overload. Users may be frustrated by the lack of control over the number of messages they are publishing.Detailed design
To resolve this issue, I propose the addition of a -L (--limit) parameter for the "mqttx bench pub" command. This parameter will allow users to set a maximum limit for the number of published messages. Here is how it would look:
If the --limit parameter is set to a value greater than 0, the command will publish up to the defined number of messages. If it's set to 0, there will be no limit to the number of messages published.
Example of use:
Command:
Explanation: This command publishes data with MQTTX Bench where:
-c 5000
means that it uses 5000 clients,-t bench/%i
is the topic to which data is published,-L 1000
limits the number of published messages to 1000.Result:
The MQTTX Bench will publish up to 1000 messages to the topic
bench/%i
using 5000 clients. If the data to be published exceeds 1000 messages, it will stop sending further messages.Alternatives
An alternative approach could be implementing a global setting for message limits that would apply to all "mqttx bench pub" commands. However, this would limit the flexibility of the command and may not be suitable for all use cases. Another alternative could be to ignore this feature, leading to issues with system overloads and reduced performance.
More detail (optional)
This feature requires modifications in how the "mqttx bench pub" command is implemented. It would need to consider the new --limit parameter and adjust the message publishing process accordingly.
Here's a simple flow diagram for better understanding:
This feature enhances the control users have over their message flow, providing a more efficient and manageable way of using MQTTX.
The text was updated successfully, but these errors were encountered: