-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from emqx/bump-lee
Bump lee
- Loading branch information
Showing
26 changed files
with
659 additions
and
513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,7 @@ TAGS | |
/*.tar.gz | ||
/emqttb | ||
/libquicer_nif.so | ||
doc/lee | ||
doc/info | ||
doc/html | ||
perf.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
When the loadgen creates too much traffic, the system may get overloaded. | ||
In this case, the test usually has to be restarted all over again with different parameters. | ||
This can be very expensive in man-hours and computing resources. | ||
|
||
In order to prevent that, emqttb can tune some parameters (such as message publishing interval) | ||
automatically using | ||
@url{https://controlguru.com/integral-reset-windup-jacketing-logic-and-the-velocity-pi-form/,PI controller}. | ||
|
||
The following formula is used for the error function: | ||
|
||
@math{e=(a_{SP} - a_{PV}) a_{coeff}} | ||
|
||
@node Autoscale | ||
@section Autoscale | ||
|
||
A special autorate controlling the rate of spawning new clients is implicitly created for each client group. | ||
Its name usually follows the pattern @code{%scenario%/conn_interval}. | ||
|
||
By default, the number of pending (unacked) connections is used as the process variable. | ||
Number of pending connections is a metric that responds very fast to target overload, so it makes a reasonable default. | ||
|
||
For example the following command can automatically adjust the rate of connections: | ||
|
||
@example | ||
./emqttb --pushgw @@conn -I 10ms -N 5_000 \ | ||
@@a -a conn/conninterval -V 1000 --setpoint 10 | ||
@end example | ||
|
||
@node SCRAM | ||
@section SCRAM | ||
|
||
Normally, autorate adjusts the control variable gradually. | ||
However, sometimes the system under test becomes overloaded suddenly, and in this case slowly decreasing the pressure may not be efficient enough. | ||
To combat this situation, @code{emqttb} has "SCRAM" mechanism, that immediately resets the control variable to a @ref{value/autorate/_/scram/override,configured safe value}. | ||
This happens when the value of process variable exceeds a @ref{value/autorate/_/scram/threshold,certain threshold}. | ||
|
||
SCRAM mode remains in effect until the number of pending connections becomes less than @math{\frac{t h}{100}} | ||
where @math{t} is threshold, and @math{h} is @ref{value/autorate/_/scram/hysteresis,hystersis}. | ||
|
||
@node Autorate List | ||
@section List of autorate variables | ||
@include autorate.texi | ||
|
||
@node Metrics List | ||
@section List of metrics | ||
@include metric.texi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
\input texinfo @c -*-texinfo-*- | ||
@c %**start of header | ||
@setfilename emqttb.info | ||
@settitle EMQTTB | ||
@c %**end of header | ||
|
||
@dircategory EMQTTB: an MQTT load generator. | ||
@direntry | ||
* EMQTTB: (emqttb). | ||
@end direntry | ||
|
||
@copying | ||
A scriptable autotuning MQTT load generator. | ||
|
||
Copyright @copyright{} 2022-2025 EMQ Technologies Co., Ltd. All Rights Reserved. | ||
|
||
@end copying | ||
|
||
@include schema.texi | ||
|
||
@c The document itself | ||
|
||
@titlepage | ||
@title EMQTTB | ||
@subtitle A scriptable autotuning MQTT load generator | ||
@page | ||
@vskip 0pt plus 1filll | ||
@insertcopying | ||
@end titlepage | ||
|
||
@c Output the table of the contents at the beginning. | ||
@contents | ||
|
||
@ifnottex | ||
@node Top | ||
@top EMQTTB | ||
|
||
@insertcopying | ||
@end ifnottex | ||
|
||
@node Introduction | ||
@chapter Introduction | ||
@include intro.texi | ||
|
||
@node Invokation | ||
@chapter Invokation | ||
EMQTTB executable accepts named CLI arguments (such as @option{--foo} or -f positional arguments and actions. Actions are special CLI arguments that start with @@ character (e.g. @option{@@pub}). Actions correspond to different load-generation scenarios, such as @option{@@pub} and @option{@@sub}, client group configurations (@option{@@g}) and autorates (@option{@@g}). | ||
|
||
Each CLI action defines its own scope of named and positional CLI arguments. Positional arguments are always specified after named arguments within the scope. There is also a global scope of arguments that don’t belong to any action. Global arguments are specified before the very first action. | ||
|
||
Example: | ||
|
||
@example | ||
emqttb --foo --bar 1 positional1 positional2 @@action1 --foo 1 positional1 @@action2 ... | ||
|___________| |_____________________| |_________________| | ||
|regular args positional args | action1 scope | ||
|___________________________________| | ||
global scope | ||
@end example | ||
|
||
Flag negation: | ||
|
||
Boolean flag arguments can be set to false by adding @code{no-} prefix, for example @option{--no-pushgw}. | ||
|
||
Short boolean flags can be set to false using @code{+} sigil instead of @code{-}. | ||
|
||
@node CLI | ||
@section CLI Arguments | ||
@lowersections | ||
@include cli_param.texi | ||
@raisesections | ||
|
||
@node OS Environment Variables | ||
@section OS Environment Variables | ||
@lowersections | ||
@include os_env.texi | ||
@raisesections | ||
|
||
@node Autorate | ||
@chapter Autorate | ||
@include autorate_descr.texi | ||
|
||
@node All Values | ||
@chapter All Configurable Values | ||
@include value.texi | ||
|
||
@node Index | ||
@unnumbered Index | ||
|
||
@syncodeindex vr cp | ||
@syncodeindex fn cp | ||
@printindex cp | ||
|
||
@bye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@node Concepts | ||
@section Concepts: Worker, Group, Scenario... | ||
|
||
@b{Worker} is a process that corresponds to a single MQTT client. | ||
|
||
@b{Behavior} is a callback module containing functions that workers run in a loop. | ||
|
||
@b{Group} is a supervised colletion of workers running the same behavior and sharing the same configuration. Group manager controls the number of workers, restarts failed workers and implements ramp up/down logic. | ||
|
||
@b{Scenario} is a callback module that creates several worker groups and manupulates group configuration using autorate. | ||
|
||
@b{Autorate} a process that adjusts group parameters (such as number of workers in the group, or worker configuration) based on constants or dynamic parameters, e.g. available RAM or CPU load, observed latency and so on. | ||
|
||
@node Topic Patterns | ||
@section Topic Patterns | ||
|
||
@code{emqttb} supports pattern substitution in the topic names. | ||
|
||
@table @samp | ||
@item %n | ||
replaced with the worker ID (integer) | ||
@item %g | ||
replaced with the group ID | ||
@item %h | ||
replaced with the hostname | ||
@end table | ||
|
||
|
||
@node Verify Message Sequence | ||
@section Message Sequence Verification | ||
|
||
@code{emqttb} has builtin tools for detecting message loss and repetition. | ||
|
||
@quotation Warning | ||
Publishers should insert metadata into the payloads in order for this feature to work. | ||
@end quotation | ||
|
||
@quotation Warning | ||
This feature can use a lot of RAM to store the sequence numbers for each triple of sender client id, receiver client id, and MQTT topic. | ||
@end quotation | ||
|
||
Errors about missing messages and warnings about duplicate messages are printed to the emqttb log. | ||
|
||
@heading Prometheus metrics | ||
|
||
@table @code | ||
@item emqttb_repeats_number | ||
number of times when the sequence number of the message goes backwards | ||
@item emqttb_gaps_number | ||
number of times when the sequence number of the message skips the messages (a gap) | ||
@item emqttb_repeat_size | ||
rolling average; size of the repeated sequence | ||
@item emqttb_gap_size | ||
rolling average; size of the gap | ||
@end table |
Oops, something went wrong.