Repository navigation
Implement CPU benchmark project - #237
Conversation
Aaronontheweb
left a comment
There was a problem hiding this comment.
Left some comments - could you also attach some sample output to this PR?
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Tmds.ExecFunction" Version="0.5.0" /> | ||
| <PackageReference Include="Universe.CpuUsage" Version="2.2.497.598" /> |
There was a problem hiding this comment.
Nice, this was the package we mentioned in akkadotnet/akka.net#5400 (comment)
| return ExecFunction.Program.Main(args); | ||
|
|
||
| // Start lighthouse | ||
| var service = new LighthouseService(LighthouseAddress, LighthousePort, ActorSystemName); |
There was a problem hiding this comment.
So we start 1 Lighthouse node in-proc and another remotely via ExecFunction?
There was a problem hiding this comment.
Right now, its one lighthouse in the main benchmark program, and then it will spawn a cluster that uses said lighthose service. Right now it is spawning a cluster with 10 nodes, all using the lighthouse as the seed node.
| // Warm up | ||
| foreach (var _ in Enumerable.Range(0, 5)) | ||
| { | ||
| CpuUsage.GetByProcess(); |
There was a problem hiding this comment.
Out of curiosity - how does this know which processes to profile? Does it just automatically profile child processes?
There was a problem hiding this comment.
Internally, CpuUsage uses an extern call to this method in kernel32.dll:
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getprocesstimes
It only handle a single process, most probably not accounting the children processes, and CpuUsage automatically inserts the current process handler when calling the method
| } | ||
|
|
||
| // Wait until things settles down | ||
| await Task.Delay(TimeSpan.FromSeconds(TestDelay)); |
There was a problem hiding this comment.
Makes sense - wait until the cluster is formed.
Log2(N) + 1 + [some fudge factor] is how many seconds it should take a cluster to form, where N is your target cluster size, FYI.
| //if (!string.IsNullOrEmpty(ipAddress)) Environment.SetEnvironmentVariable("CLUSTER_IP", ipAddress); | ||
|
|
||
| //if (specifiedPort != null) | ||
| // Environment.SetEnvironmentVariable("CLUSTER_PORT", specifiedPort.Value.ToString()); |
There was a problem hiding this comment.
We probably need to add this back?
There was a problem hiding this comment.
I already added it back, but instead of injecting it into the environment variable, I did a config fallback instead
|
Uhhhh.... I guess our merge bot merges stuff even though I only commented, not approved.... Good to know I guess. |
This reverts commit 9a9b937.
No description provided.