-
Notifications
You must be signed in to change notification settings - Fork 25
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
Improve latency handling #494
Conversation
GenStage multi calls can be a bottleneck This one is to try to leverage direct process spawning for each message
we can also leverage this, as Mentioned by Samuel.
|
34e82ed
to
390e75b
Compare
@@ -59,6 +59,7 @@ defmodule Archethic.P2P.Message do | |||
alias __MODULE__.RegisterBeaconUpdates |
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.
A better way for import can be like this syntax : alias MODULE.{ModuleName1, ModuleName2, etc.}.
https://elixir-lang.org/getting-started/alias-require-and-import.html#multi-aliasimportrequireuse
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.
I think this can be improved for the entire codebase, so the scope of the PR would be too big I guess.
But yes you are right, it might be better.
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.
Few typos and improvements can be made.
Renaming `from_map` to `cast` remove the confusion with the function `to_map` which is used by the api while the `cast` is used by the db to convert map to struct.
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.
Tested with comcast with 2 nodes locally, worked fine.
comcast --device=lo --latency=200 --target-bw=1000 --packet-loss=10%
LGTM
Description
Improve latency handling to make the system more resilient
Fixes #498 #497 #499
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
To test with high latency, we can use a tool like comcast and with some latencies:
Checklist: