-
Notifications
You must be signed in to change notification settings - Fork 383
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
Make gossip routines use TrySend, not Send #3186
Labels
Comments
Hey, I have in my backlog checking the usage of In particular because when |
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Request
Currently our gossip routines for vote and block gossip use
Send
notTrySend
.Send
is worse thanTrySend
in terms of our net CPU overhead due to instantiating multiple timers. The way select statements in golang work, is that every argument gets evaluated, and timer.NewTimer takes overhead to instantiate, and significant overhead to our scheduler to create. Its not clear to me we are ever benefitting in the gossip routine by usingSend
though. Lets think through the cases:Problem Definition
Here is where we see it adding overhead to us:
![image](https://private-user-images.githubusercontent.com/6440154/336559602-a86d56e4-f61d-4cd9-a787-eaf3ebb60ae1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxMTEzOTgsIm5iZiI6MTcxOTExMTA5OCwicGF0aCI6Ii82NDQwMTU0LzMzNjU1OTYwMi1hODZkNTZlNC1mNjFkLTRjZDktYTc4Ny1lYWYzZWJiNjBhZTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjNUMDI1MTM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODIyZDZiYzAyMTZmZDg5NGI1ZjgyMDVkYjljZTA3ODQ3NTI5YWE2MjBjMzYzMDQzNTQ0N2I1MjRmOGUzNGFmOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.2wiR47t3JT5nMO66gIPTkJik4bLQOiIzEtT-Ar-fDGE)
(About 10% of the current gossip routine CPU time, but other concurrent work lowering overhead)
evidence of the go scheduler being high overhead right now. So likely we'd benefit from a few less timers.
![image](https://private-user-images.githubusercontent.com/6440154/336559840-6697aa94-004b-4997-a7c0-00189b2f4761.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxMTEzOTgsIm5iZiI6MTcxOTExMTA5OCwicGF0aCI6Ii82NDQwMTU0LzMzNjU1OTg0MC02Njk3YWE5NC0wMDRiLTQ5OTctYTdjMC0wMDE4OWIyZjQ3NjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjNUMDI1MTM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTg0OWE5MDBlZGY4ZTY1OGE2Zjc5YzU0OTBhNjQxOTg3MjBiYzJmZDZlZTRkNjA1ZTlkMjE0YTBiYWNkZmJkMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.GvNs25CYjonKcTAPwigLG0pvwgPODY1g4gsb_EJpy20)
Proposal
Change gossip routines to use TrySend and not Send.
Is there any suggested QA process for this?
The text was updated successfully, but these errors were encountered: