-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[PERF] Akka.Cluster Idle CPU on ARM #7223
Comments
I posted view years some system API's to read the consume cycles from a process for windows/linux |
I thought the biggest culprits for this would have been our |
#5400 (comment) maybe we can implement something like a StopWatch with it, but for CPU cycles. |
Don't talk about the issue itself, but about your measurements. We don't need to use the same metrics, |
Ah got it, you think this might just be an instrumentation issue then? |
Worth mentioning: I requisitioned all of the hardware for building a long-term Akka.NET observation lab yesterday https://x.com/Aaronontheweb/status/1797731816042049944 Going to have some experiments that are designed to run continuously for months in here, including idle CPU measurements. Bought a Raspberry Pi 5 for testing ARM support specifically. |
the used distro/kernel level can make a difference too. Tip: |
I will make a demo project for the cycle measurement. |
Good idea - was planning on having a log-aggregator and OTEL running on a separate host (x64 instance) |
@Aaronontheweb |
@Aaronontheweb There are some registers in x64 and armv6+ to read cycles for the thread out, The best unit would be to measure "CPU units" like linux and clouds provider do. Win and Linux provide counters for process and thread cpu time, It can be used for a simple integration tests to measure the idle cluster CPU Simplest form of a idle integration test var p = Process.GetCurrentProcess();
var sw = new Stopwatch();
var processorTime0 = p.TotalProcessorTime;
sw.Start();
//do work or idle around
await Task.Delay(10_000);
var processorTime1 = p.TotalProcessorTime;
sw.Stop();
var processorTime = processorTime1 - processorTime0;
var cpuUnits = processorTime / sw.Elapsed;
//was idling?
Assert.True(cpuUnits < 0.01) I put the tests in the above repo. |
We're just planning on sticking it in K8s with its own namespace and measuring mCPU used over time on a Grafana chart |
Version Information
Version of Akka.NET? v1.5.21
Which Akka.NET Modules? Akka.Cluster, Akka.Remote, Akka
Describe the performance issue
From a user in our Discord - it looks like Akka.Cluster has significantly higher idle CPU on Apple Silicon ARM chips that it does on x64 chips.
Data and Specs
Expected behavior
Idle CPU should be less than 1% per process across all platforms.
Actual behavior
Idle CPU can be as high as 28% on ARM.
Additional context
This is mostly a .NET runtime issue, but we should keep an eye on in it in case there's something we're doing to exacerbate it or if there's something we can do to mitigate the issue.
The text was updated successfully, but these errors were encountered: