chat and chat-tokio examples: high CPU consumption (Ubuntu 20.04)
Summary
Both chat and chat-tokio examples have very high CPU consumption (close to 100%).
Expected behaviour
I do not expect the examples to have such an high CPU consumption when no messages are exchanged.
Actual behaviour
I have two instances of chat (chat-tokio) example running on the same machine. After the publication of the first message by part of the first peer (that is correctly received by the second one), the CPU consumption of the processes increases significantly and reaches 100%.
Possible Solution
When we tested the same examples on a machine running macOS, we have not observed such an high CPU usage.
Version
- libp2p version: master branch
- OS: Linux Ubuntu 20.04
Would you like to work on fixing this bug?
Yes.
Thanks for the report. https://github.com/tokio-rs/console might help here debugging the issue. Help greatly appreciated.
@ddeguglielmo with the latest changes to libp2p-mdns does the above issue still persist?
Hello @mxinden, I have just finished testing both chat and chat-tokio examples (I used the current master branch version). The examples work correctly and the CPU consumption of the processes is very low. Thus the issue is not present anymore.
Wonderful. Thanks @ddeguglielmo for testing. And of course @gallegogt and @thomaseizinger for fixing this issue!