-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mqtt] Benchmark broker message dispatching #2897
Conversation
} | ||
group.finish(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these three methods look exactly the same, except the strategy they create and the name. Can it be made into a single method, and fan_in()/fan_out()/one_to_one() just call that single method with a "strategy creator" function injected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I thought about that. I still wonder if number of publishers should not be equal number of subscribers. it may vary depending on strategy...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
ClientEvent::DropConnection | ||
| ClientEvent::CloseSession | ||
| ClientEvent::Disconnect(_) => { | ||
stop = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: log(...); break;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it logged bellow
In order to verify how quickly broker can dispatch messages we need some benchmark tests.
dispatch_message
benches start broker with empty state and no network connections. Firstly, each bench test creates a given number of publishers, subscribers and connects them to a broker. Then it makes a series of exercises to send messages to a broker and measures the time between a message successfully sent to a broker and broker processed this message. For this case broker extended with aon_publish
"callback" which has to be exposed only for benchmark tests.Scenarios supported:
1-to-1
Each publisher sends messages to one corresponding subscriber:
fan-in
All publishers send message to a randomly chose topic
fan-out
Multiple publishers sends messages to a topic all subscribers subscribed to
How to run benches
or
to run all benches