-
Notifications
You must be signed in to change notification settings - Fork 22
Add more control over loadgen/latencies #394
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
Changes from all commits
a3d6e05
ad4e6d8
282127d
d951b16
62f6b28
c75ec3d
4b86894
30ae4e0
003e5f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,8 +73,12 @@ type MissionOptions | |
| apiRateLimit: int, | ||
| httpProxyReplicas: int, | ||
| pubnetData: string option, | ||
| pubnetDataDelay: bool, | ||
| measureE2eLatency: bool, | ||
| peerAuthenticationTimeout: int option, | ||
| flatQuorum: bool option, | ||
| tier1Keys: string option, | ||
| loadgenKeys: string option, | ||
| maxConnections: int option, | ||
| fullyConnectTier1: bool, | ||
| byteCountValues: seq<int>, | ||
|
|
@@ -318,12 +322,32 @@ type MissionOptions | |
| [<Option("pubnet-data", HelpText = "JSON file containing pubnet connectivity graph data", Required = false)>] | ||
| member self.PubnetData = pubnetData | ||
|
|
||
| [<Option("pubnet-data-delay", | ||
| HelpText = "Set to use the new style format for --pubnet-data", | ||
| Required = false, | ||
| Default = false)>] | ||
| member self.PubnetDataDelay = pubnetDataDelay | ||
|
|
||
| [<Option("measure-e2e-latency", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh that's a good idea! |
||
| HelpText = "Set to enable the loadgen e2e metrics", | ||
| Required = false, | ||
| Default = false)>] | ||
| member self.MeasureE2eLatency = measureE2eLatency | ||
|
|
||
| [<Option("peer-authentication-timeout", | ||
| HelpText = "Maximum time overlay waits for a peer to authenticate before dropping", | ||
| Required = false)>] | ||
| member self.PeerAuthenticationTimeout = peerAuthenticationTimeout | ||
|
|
||
| [<Option("flat-quorum", HelpText = "Use flat Tier1 quorum", Required = false)>] | ||
| member self.FlatQuorum = flatQuorum | ||
|
|
||
| [<Option("tier1-keys", HelpText = "JSON file containing list of 'tier-1' pubkeys from pubnet", Required = false)>] | ||
| member self.Tier1Keys = tier1Keys | ||
|
|
||
| [<Option("loadgen-keys", HelpText = "JSON file containing list of pubkeys to generate load", Required = false)>] | ||
| member self.LoadgenKeys = loadgenKeys | ||
|
|
||
| [<Option("max-connections", | ||
| HelpText = "Maximum number of connections to allow any node in pubnet data to have. When enabled, this option will prune connections for any node with more than this number of connections. (default: no limit)", | ||
| Required = false)>] | ||
|
|
@@ -743,6 +767,15 @@ let main argv = | |
| 0 | ||
|
|
||
| | :? MissionOptions as mission -> | ||
| if mission.PubnetData.IsNone && mission.PubnetDataDelay then | ||
| failwith "Error: --pubnet-data-delay requires --pubnet-data to be set" | ||
|
|
||
| if mission.LoadgenKeys.IsSome && mission.PubnetData.IsNone then | ||
| failwith "Error: --loadgen-keys requires --pubnet-data to be set" | ||
|
|
||
| if mission.MeasureE2eLatency && mission.LoadgenKeys.IsNone then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should LoadgenKeys also require PubnetData configured? I think otherwise, the keys may not match the auto-generated topology.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. The auto-generated topology uses a different function that doesn't look at the loadgen keys or the tier-1 keys. Updating for the loadgen key case. |
||
| failwith "Error: --measure-e2e-latency requires --loadgen-keys" | ||
|
|
||
| let _ = logToConsoleAndFile (sprintf "%s/stellar-supercluster.log" mission.Destination) | ||
|
|
||
| let ll = | ||
|
|
@@ -848,8 +881,12 @@ let main argv = | |
| apiRateLimit = mission.ApiRateLimit | ||
| httpProxyReplicas = mission.HttpProxyReplicas | ||
| pubnetData = mission.PubnetData | ||
| pubnetDataDelay = mission.PubnetDataDelay | ||
| measureE2eLatency = mission.MeasureE2eLatency | ||
| peerAuthenticationTimeout = mission.PeerAuthenticationTimeout | ||
| flatQuorum = mission.FlatQuorum | ||
| tier1Keys = mission.Tier1Keys | ||
| loadgenKeys = mission.LoadgenKeys | ||
| maxConnections = mission.MaxConnections | ||
| fullyConnectTier1 = mission.FullyConnectTier1 | ||
| byteCountDistribution = | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -337,8 +337,13 @@ let minBlockTimeTest (context: MissionContext) (baseLoadGen: LoadGen) (setupCfg: | |
| None } | ||
|
|
||
| let tier1 = List.filter (fun (cs: CoreSet) -> cs.options.tier1 = Some true) allNodes | ||
| let loadGenNodes = List.filter (fun (cs: CoreSet) -> cs.options.generatesLoad) allNodes | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. trying to think about the setup and parameters we're going to use to run this test. I believe in this comment #394 (comment) you mentioned wanting to update MinBlockTest mission to output e2e latency. Is that still the plan? (no worries if you want to split work into multiple PRs, and keep this one scoped for now)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still looking at different options for how to run the test (my current local runs are using a modified
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, using slp_eval seems fine (might need to rename or refactor the script though since this work isn't related to slps) |
||
|
|
||
| let loadGenNodes = if List.length allNodes > smallNetworkSize then tier1 else allNodes | ||
| let loadGenNodes = | ||
| if List.isEmpty loadGenNodes then | ||
| if List.length allNodes > smallNetworkSize then tier1 else allNodes | ||
| else | ||
| loadGenNodes | ||
|
|
||
| let isLoadGenNode cs = List.exists (fun (cs': CoreSet) -> cs' = cs) loadGenNodes | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,6 +166,7 @@ type StellarCoreCfg = | |
| automaticMaintenanceCount: int | ||
| accelerateTime: bool | ||
| generateLoad: bool | ||
| measureE2eLatency: bool | ||
| updateSorobanCosts: bool option | ||
| manualClose: bool | ||
| invariantChecks: InvariantChecksSpec | ||
|
|
@@ -317,6 +318,9 @@ type StellarCoreCfg = | |
| t.Add("ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING", self.accelerateTime) |> ignore | ||
| t.Add("ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING", self.generateLoad) |> ignore | ||
|
|
||
| if self.measureE2eLatency && self.network.missionContext.measureE2eLatency then | ||
| t.Add("LOADGEN_MEASURE_TX_E2E_LATENCY_FOR_TESTING", true) |> ignore | ||
|
|
||
| if self.updateSorobanCosts.IsSome then | ||
| t.Add("UPDATE_SOROBAN_COSTS_DURING_PROTOCOL_UPGRADE_FOR_TESTING", self.updateSorobanCosts.Value) | ||
| |> ignore | ||
|
|
@@ -365,6 +369,10 @@ type StellarCoreCfg = | |
| t.Add("MAX_ADDITIONAL_PEER_CONNECTIONS", self.targetPeerConnections * 3) | ||
| |> ignore | ||
|
|
||
| match self.network.missionContext.peerAuthenticationTimeout with | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default timeout is a few seconds, which is quite long. Is there a particular reason to bump this timeout?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to run a simulation with excessively long (more than ~2 seconds) delays (e.g., to simulate a slow node), it is useful to be able to configure the peer authentication timeout.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, though I'm not sure that's needed for perf simulations. To avoid noise from slow nodes and properly validate changes to perf, I think all nodes in the simulation have to assume normal latency. Evaluation will be harder if we have outliers that are too slow. |
||
| | Some timeout -> t.Add("PEER_AUTHENTICATION_TIMEOUT", timeout) |> ignore | ||
| | None -> () | ||
|
|
||
| t.Add("QUORUM_INTERSECTION_CHECKER", false) |> ignore | ||
| t.Add("MANUAL_CLOSE", self.manualClose) |> ignore | ||
|
|
||
|
|
@@ -653,6 +661,7 @@ type NetworkCfg with | |
| automaticMaintenanceCount = if opts.performMaintenance then 50000 else 0 | ||
| accelerateTime = opts.accelerateTime | ||
| generateLoad = true | ||
| measureE2eLatency = opts.generatesLoad | ||
| updateSorobanCosts = opts.updateSorobanCosts | ||
| manualClose = false | ||
| invariantChecks = opts.invariantChecks | ||
|
|
@@ -698,6 +707,7 @@ type NetworkCfg with | |
| automaticMaintenanceCount = if c.options.performMaintenance then 50000 else 0 | ||
| accelerateTime = c.options.accelerateTime | ||
| generateLoad = true | ||
| measureE2eLatency = c.options.generatesLoad | ||
| updateSorobanCosts = c.options.updateSorobanCosts | ||
| manualClose = false | ||
| invariantChecks = c.options.invariantChecks | ||
|
|
||
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.
Should we just update the --pubnet-data format to new style everywhere? That seems simpler than maintaining two formats. If latency isn't configured in the new format, we can fallback to old-style geolocations.
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.
Friendly reminder than we'll need to check-in the new pubnet data JSON somewhere. I guess it would be in https://github.com/stellar/stellar-supercluster. No worries if you want to wait until this PR lands though, in case there are any last minute changes to the format.
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 about them as serving different purposes. With the existing geoloc-style data, it's easier to support adding/removing nodes and edges with the existing flags while the new style is more useful for running a particular network configuration/experimenting with how we model simulated latencies (e.g., it is easy to check the difference between running using the survey data vs running using our existing geoloc-based delay model).
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.
sorry, not sure I understand. Both formats have most of their parameters overlap, right? Is the difference in the new style that we add the delay field?
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.
As written, the new style change relative to the old style is that geodata field is removed and the per-node
peerslist becomes a list of{key, owdMs}objects instead of a list of (string) keys. The new-style format makes it hard to support flags like--tier1-orgs-to-addor--non-tier1-nodes-to-add. In the old version, we can just randomly pick geolocations and synthesize the delay, but it's harder to do something similar in the new format (the nodes don't have geolocations in the new model and mixing latency models feels potentially problematic).