-
Notifications
You must be signed in to change notification settings - Fork 179
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
Reduce TX/RX buffers allocation #1749
Conversation
PR missing one of the required labels: {'new feature', 'documentation', 'enhancement', 'bug', 'dependencies', 'internal', 'breaking-change'} |
In None => break WBatch::new_ephemeral(self.batch_config), the throughput is then increased by 1Mmsg/s for 8B messages on my computer (MacBook Air M3). The effect of this line is that each batch is freshly allocated instead of going through the recycling pipeline.
If we then modify the code to limit the number of concurrent allocated batches to the one of the config, still keeping the allocation on demand behavior, we obtain this time a small throughput reduction, around 100kmsg/s or less, so 1.6% of 6.3Mmsg/s. This should be the cost of allocating on demand, so not very high regarding throughput. On the other hand, it gives a fully elastic memory consumption, that could decrease the total memory footprint. This allocation on demand behavior could even be customized to start with a smaller batch, for example 1kB, and only increase the size if in case of demanding throughput/big payloads. |
@@ -475,6 +475,12 @@ | |||
/// The maximum time limit (in ms) a message should be retained for batching when back-pressure happens. | |||
time_limit: 1, | |||
}, | |||
allocation: { |
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.
Is there a result that shows that the first allocation has a sensible effect, which would justify the need of this configuration addition?
I agree that Regarding the sensible effects on the first allocation, I didn't observer any. I can do a new PR for changing the defaults on top of this one for better traceability. |
If there is no sensible effect, I would be against adding more stuff to the configuration. |
I see your point, but the lack of sensible effect is the effect we measured on our machines. |
#1751 changes the default configuration and targets this PR branch. |
You decide then. |
* Bump: zenoh-cpp=bd4d741 zenoh-c=15d56e1 zenoh=e17de41 * Config: add new gossip target setting (eclipse-zenoh/zenoh#1678) * Config: add new interests timeout setting (eclipse-zenoh/zenoh#1710) * Config: copy updates from eclipse-zenoh/zenoh#1712 * Config: copy updates from eclipse-zenoh/zenoh#1722 * Config: copy updates from eclipse-zenoh/zenoh#1749 * Config: copy updates from eclipse-zenoh/zenoh#1751 * fix: use the commit 15d56e1 to include the allocation feature * Bump zenoh-c=5fce7fb zenoh=e4ea6f0 (for eclipse-zenoh/zenoh#1754 fixing a routing issue in 1.2.0) * Update documentation for commits and undo style changes Signed-off-by: Yadunund <[email protected]> --------- Signed-off-by: Yadunund <[email protected]> Co-authored-by: yuanyuyuan <[email protected]> Co-authored-by: Yadunund <[email protected]>
* Bump: zenoh-cpp=bd4d741 zenoh-c=15d56e1 zenoh=e17de41 * Config: add new gossip target setting (eclipse-zenoh/zenoh#1678) * Config: add new interests timeout setting (eclipse-zenoh/zenoh#1710) * Config: copy updates from eclipse-zenoh/zenoh#1712 * Config: copy updates from eclipse-zenoh/zenoh#1722 * Config: copy updates from eclipse-zenoh/zenoh#1749 * Config: copy updates from eclipse-zenoh/zenoh#1751 * fix: use the commit 15d56e1 to include the allocation feature * Bump zenoh-c=5fce7fb zenoh=e4ea6f0 (for eclipse-zenoh/zenoh#1754 fixing a routing issue in 1.2.0) * Update documentation for commits and undo style changes Signed-off-by: Yadunund <[email protected]> --------- Signed-off-by: Yadunund <[email protected]> Co-authored-by: yuanyuyuan <[email protected]> Co-authored-by: Yadunund <[email protected]> (cherry picked from commit d322d6f)
* Bump: zenoh-cpp=bd4d741 zenoh-c=15d56e1 zenoh=e17de41 * Config: add new gossip target setting (eclipse-zenoh/zenoh#1678) * Config: add new interests timeout setting (eclipse-zenoh/zenoh#1710) * Config: copy updates from eclipse-zenoh/zenoh#1712 * Config: copy updates from eclipse-zenoh/zenoh#1722 * Config: copy updates from eclipse-zenoh/zenoh#1749 * Config: copy updates from eclipse-zenoh/zenoh#1751 * fix: use the commit 15d56e1 to include the allocation feature * Bump zenoh-c=5fce7fb zenoh=e4ea6f0 (for eclipse-zenoh/zenoh#1754 fixing a routing issue in 1.2.0) * Update documentation for commits and undo style changes Signed-off-by: Yadunund <[email protected]> --------- Signed-off-by: Yadunund <[email protected]> Co-authored-by: yuanyuyuan <[email protected]> Co-authored-by: Yadunund <[email protected]> (cherry picked from commit d322d6f)
* Bump: zenoh-cpp=bd4d741 zenoh-c=15d56e1 zenoh=e17de41 * Config: add new gossip target setting (eclipse-zenoh/zenoh#1678) * Config: add new interests timeout setting (eclipse-zenoh/zenoh#1710) * Config: copy updates from eclipse-zenoh/zenoh#1712 * Config: copy updates from eclipse-zenoh/zenoh#1722 * Config: copy updates from eclipse-zenoh/zenoh#1749 * Config: copy updates from eclipse-zenoh/zenoh#1751 * fix: use the commit 15d56e1 to include the allocation feature * Bump zenoh-c=5fce7fb zenoh=e4ea6f0 (for eclipse-zenoh/zenoh#1754 fixing a routing issue in 1.2.0) * Update documentation for commits and undo style changes Signed-off-by: Yadunund <[email protected]> --------- Signed-off-by: Yadunund <[email protected]> Co-authored-by: yuanyuyuan <[email protected]> Co-authored-by: Yadunund <[email protected]> (cherry picked from commit d322d6f) Co-authored-by: Julien Enoch <[email protected]>
* Bump: zenoh-cpp=bd4d741 zenoh-c=15d56e1 zenoh=e17de41 * Config: add new gossip target setting (eclipse-zenoh/zenoh#1678) * Config: add new interests timeout setting (eclipse-zenoh/zenoh#1710) * Config: copy updates from eclipse-zenoh/zenoh#1712 * Config: copy updates from eclipse-zenoh/zenoh#1722 * Config: copy updates from eclipse-zenoh/zenoh#1749 * Config: copy updates from eclipse-zenoh/zenoh#1751 * fix: use the commit 15d56e1 to include the allocation feature * Bump zenoh-c=5fce7fb zenoh=e4ea6f0 (for eclipse-zenoh/zenoh#1754 fixing a routing issue in 1.2.0) * Update documentation for commits and undo style changes Signed-off-by: Yadunund <[email protected]> --------- Signed-off-by: Yadunund <[email protected]> Co-authored-by: yuanyuyuan <[email protected]> Co-authored-by: Yadunund <[email protected]> (cherry picked from commit d322d6f) Co-authored-by: Julien Enoch <[email protected]>
This reverts commit 6360eb6
This reverts commit 6360eb6
This PR:
This allows to reduce the number of allocated batches that are not utilised.
In general it should improve the overall memory consumption when many links are established.
Validation
Target
AMD Ryzen 7 5800X 8-Core Processor
32GB of RAM
Config
Queue configuration (
queue.conf.json5
)Test
Run
zenohd
:Run 100
z_sub
:Run 100
z_pub
:Results
Baseline memory usage:
3.45G
.Memory mode:
14.9G/31.3G
→11.45G
in total (56.97M
per process)10.2G/31.3G
→6.75G
in total (33.58M
per process)In case of
z_sub
/z_pub
the gain is4.7G
less memory.