Comments (9)
Adding to Saar's point, the calculation is correct but expected in Linux if we don't include the available memory, customers will not benefit from this trigger with this current state unless this trigger measures against the host node and not the container. If the Host level is not feasible, below are the results of my testing and proposed calculation:
From the container:
As you can see, the free memory is 81/1790 of Total memory, so the number is 95%. we can see that the container is idle because:
1- High amount of allocated memory for buff/cache (expected)
2- Swap memory is not being used, more details in the below image, there is no high si/so operations:
In my testing if we can make the calculation 1 - (Free + Available)/Total, it will be close to the actual host memory usage:
from applicationinsights-profiler-aspnetcore.
@mumustafa, thanks for chiming in. I am considering a simpler calculation of:
1 - available / total
Here are my reasons:
-
According to the spec:
MemAvailable %lu (since Linux 3.14) An estimate of how much memory is available for starting new applications, without swapping.
And that's what the user actually cares about - how much memory is available.
-
It's more accurate, and I believe
available
already hasfree
considered in it.-
In a system that is heavily buffered, using your example, there's not too much difference:
1 - (free + available) / total = 1 - (81 + 532) / 1790 = 66%, compare to:
1 - available / total = 1 - 532 / 1790 = 70% -
However, in a system that is not heavily buffered, like this one on a WSL:
1 - (free + available) / total = 1 - (11906 + 14246) / 15930 = -64% <---- this negative number doesn't make sense. And compare to:
1 - available / total = 1 - 14246 / 15930 = 11%
-
The big difference I see, is that available + free might exceed total while available is always less than the total.
Any inputs?
from applicationinsights-profiler-aspnetcore.
@xiaomi7732 You're 100% on point, I was looking at it from the free command perspective as well: https://man7.org/linux/man-pages/man1/free.1.html
Looking at the commit description: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 also confirms your findings.
from applicationinsights-profiler-aspnetcore.
Stable package released:
https://www.nuget.org/packages/Microsoft.ApplicationInsights.Profiler.AspNetCore/2.5.3
from applicationinsights-profiler-aspnetcore.
from applicationinsights-profiler-aspnetcore.
Check this out:
https://www.nuget.org/packages/Microsoft.ApplicationInsights.Profiler.AspNetCore/2.5.3-beta1
As we discussed, memory usage on linux will be computed by 1 - ( available / total )
.
from applicationinsights-profiler-aspnetcore.
from applicationinsights-profiler-aspnetcore.
Thank you Saar! this is looking great!
from applicationinsights-profiler-aspnetcore.
Thank you for bringing this up!
from applicationinsights-profiler-aspnetcore.
Related Issues (20)
- visual studio and docker-compose not working. HOT 2
- Repeated "Instrumentation Key is empty." error messages in logs since v2.5.0 HOT 8
- Worker service sometimes hangs at profiler startup HOT 4
- The scheduling policy of OneTimeSchedulingPolicy is not registered to an orchestrator. HOT 5
- This repo is missing important files
- Could not get the stamp id. Aborting the upload process HOT 15
- [Feature] Handle throttling of 429 better
- Trace file is left when the process crashed before stopping the profiling HOT 5
- The EventPipe Profiler doesn't work with Azure Function (App Service Plan)
- Remove the support of SkipUpload
- EventPipe session was not disposed upon stopping exception
- How-To Use it Properly with OpenTelemetry NuGet? HOT 1
- Please Update Examples To Use APPLICATIONINSIGHTS_CONNECTION_STRING Instead of APPINSIGHTS_INSTRUMENTATIONKEY
- Reduce dependency logging for certain API calls HOT 1
- Profiler throws error in trace: AI: Process was called on the TelemetrySink after it was disposed HOT 2
- Role name in application insights profile list HOT 6
- Bump up the target framework for the uploader to .NET 6
- Issue with starting and stopping a process with the profiler running in same process HOT 2
- When you publish an update for Microsoft.ApplicationInsights.Profiler.AspNetCore, don't mark the previous version as deprecated immediately HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applicationinsights-profiler-aspnetcore.