Profiling memory usage of ASP.NET Core 6 site in production - profiling

We have an ASP.NET Core 6 site in production where the memory and cpu usage looks this this:
The cpu peaks seems more to be a consequence of memory not being available and we see OutOfMemoryException in the logs.
We are using Application Insights but I don't find a way to see what data is getting stored in memory. The total memory consumption obviously comes from multiple things (operating system etc) but is there a way to log what data the ASP.NET Core application is storing?

Profiling memory usage of ASP.NET Core 6
Created and deployed Azure App Service .NetCore 6 with Application Insights.
Check the below steps to enable Profiler for the deployed App Service
Enable the Always on option.
Enable Profiler option from Application Insights.
Navigate to Your App Service => Application Insights => Make sure you have Enabled Application Insights .
Turn on the Profiler option to on.
Transaction Search
Application Insights => Transaction Search
In your Application Insights => Performance => Profiler
Triggers => set CPU, Memory and Sampling to On and click on Profile now.
Click on the session to get the detailed Info.
References taken from MSDoc

Related

Stackdriver Dashboards eating all our memory

I often have to build Stackdriver dashboards. The browser tab of an ordinary dashboard with six charts clocks in at 1.8 GB (!) in Google Chrome Task Manager.
This would normally be a question for the product team, but next to its sluggish behaviour (e.g. compared to Grafana dashboards) and it crippling machines, this hasn't changed since its initial introduction to GCP years ago.
So my question: How to reduce the load on project members' workstations? Via dashboard design, a specific way of using the dashboards, or maybe browser plugins?

What is Application Insight in Visual Studio

I can see number in thousand as Application Insights in Visual Studio 2017. I read about the Application Insights but does not exactly understood what is use of it.
As shown in below screenshot, its showing 25K in Application Insights and continuously increasing. Messaging_TestApp is SQL Database name used for NService bus.
Can anyone explain what is Application Insights and why number increasing ?
First, let me answer the basic "What is App Insights?":
Application insights is essentially an activity monitoring tool from Microsoft for any type of application.
From Microsoft's documentation on What is Application Insights?
Application Insights is an extensible Application Performance Management (APM) service for web developers on multiple platforms. Use it to monitor your live web application. It will automatically detect performance anomalies. It includes powerful analytics tools to help you diagnose issues and to understand what users actually do with your app. It's designed to help you continuously improve performance and usability. It works for apps on a wide variety of platforms including .NET, Node.js and J2EE, hosted on-premises or in the cloud. It integrates with your DevOps process, and has connection points to a variety of development tools. It can monitor and analyze telemetry from mobile apps by integrating with Visual Studio App Center.
Now, the more specific parts of your question:
What you are seeing in Visual Studio?
Application insights is normally run on a server sitting somewhere or purchased as a service from Azure, but it was recently also built into Visual Studio for monitoring apps running out of the IDE. The VS IDE is essentially running a sort of minified version of Application Insights that has then hooked into the SQL Database project you are currently debugging.
What is the Banner number?
From my own testing this number appears to be the total number of telemetry logs Application Insights has recorded since I started the application. Perhaps most of them are being filtered out by your 30m time range.

What are my technical requirements?

My goal is to build an application that can dynamically monitor my Stock Portfolio (Stock Options actually). So, I am building my business logic in a TDD approach using C# on .NET core. I haven't much thought about the interface because the following is true:
1) My broker is ETrade so I will have to authenticate and use their api for my position information
2) I need this application to run from 9:30 AM - 4:00 PM EST Monday - Friday
As I am nearing completion of my 1st MVP business logic, I am now starting to think about where I will delpoy the final solution and hence I am seeking the community for feedback.
I have heard, but not worked much with Microservices (AWS, Azure, etc.) so I'm not sure if that is the direction I want to look. (Also, I have a tight timeline and don't want to have to learn too much to get this thing deployed - but I am open to any solution). Excluding Microservices and the Cloud I have considered the following:
a) "I could run the program from a Console application"?
(answer) I would have to either:
(a) get a dedicated server to do or
(b) try to ensure that I can leave a laptop running at home or something, blah, blah
(conclusion) Both are plausible decisions.
b) "I could run the program as a Windows Service"
(answer) I would have to either
(a) (same as above)
(b) (same as above)
(conclusion) Both are plausible decisions.
c) "I could run the program as a Web Site"
(answer) I would have to either
(a) (same as above)
(b) (same as above)
(conclusion) Both are plausible decisions.
c) "I could investigate The Cloud (Microservices)"
(answer) ???
(conclusion)
So, in closing, basically, given the requirements of up-time between those hours and I would like to be able to access the app from any internet browser. I have logic that needs to ping various endpoints pretty much every minute during market hours. So I am not sure how I would handle this using a Web Application because if (by chance) the browser is closed, the Web Application stops running and thus would defeat my needs! Does the cloud help here? Maybe I should just use a Windows Service and make my logs accessible on the web. Or I deploy the TraderBot in a Windows Service and also build a Web Application to receive real-time intel from the TraderBot Windows Service / Logs / and-or DB? Not sure, but I appreciate any knee-jerk responses you all have!
I really like to connect pieces of tech to solve complex problems. Though it's not that complex.
Solution 1: Cloud-based, specifically on AWS
Use AWS Lambdas(Serverless compute) to hit the API to get prices or whatever info you are seeking and then store it in DynamoDb(A NoSQL DB). Use CloudWatch Rules(Serverless CRON job) to invoke your lambda periodically.
Then SPA Single page application to view values stored in DynamoDb. It can be a static website hosted on S3 also.
Or
A mobile app can also serve the purpose of viewing the data from DynamoDb.
Solution 2: Mobile-Only
Why not build the app purely for mobiles like iOS or Android. Check here I've coded one app just to track the price of different alt-coins of different exchanges.
With the mobile-only app, your app will fetch the prices periodically(Using alarms API in case of Android) and will store in its local database(SQLite in case of Android) and then you can open the app any time to see the latest values.
More solutions can be thought of, But I think above are a good approach for solving this problem rather than buying a VPS or blowing your laptop all 24X7 #ThinkCloud
PS: Initial thoughts only, Ask more to enhance the solution... :)

Coldfusion 9 determine all session scope memory used

We are running Coldfusion 9.0.2 multi instance, JVM1.7.0_25 on a windows 2008 server. Coldfusion instance 2's memory has grown and is staying high even though there aren't a lot of requests when I look at it. According to Fusion Reactor the Old Gen is using most of the memory which leads me to ask why. It looks like there are about 270 active sessions. I would like to see how much memory is being used by each session and what session variables are in each session. Any ideas for either of these?
Thanks in advance.
Joe
Joe, you are using the Enterprise edition of ColdFusion so you have built in Monitoring Tools. Log into the CF Admin for the instance you want to monitor and enable and launch Monitoring. There is a section in monitoring that will show you how much memory is being used by each CF Application and by each user Session. To see this data you need to enable Memory Profiling. It is advised that this feature remain disable except for the time you need to look at data then turn it off again. Memory Profiling can add a lot of extra load to the server in some cases.

Any tools to monitor IIS and application performance

I have a web-service application that exposes lot of web-methods ( internally calling internal APIs or external web-services). I would like to have a tool to monitor this whole application running under IIS. To be clear I just don't want to inspect the requests that are failing, I also would like to see things like how long different calls are taking . I guess it has to be something like SQL Profiler tool
where you can look at all types of queries ( those that run successfully and those that fail too) and then apply all sorts of filter in focusing on the areas that interests you more.
Is there anything built in IIS that could be used for this purpose?
What you are looking for is a runtime profiler for the CLR. The answer is ETW tracing. The tool that can help is PerfMonitor.
IIS 7 has failed request tracing which can help in diagnosing the cause for the
failure.
Also IIS logs have lot of information on request, response,duration and few more
which can be helpful in getting metrics. I usually use Log Parser for getting
metrics from IIS logs
And if you are in IIS7+ then you could use built-in ETW tracing for webservices.
Here is the ETW provider for webservice
e04fe2e0-c6cf-4273-b59d-5c97c9c374a4: Microsoft-Windows-WebServices Microsoft-Windows-WebServices
For any application running under ASP.NET, you can use perfmon to look at different performance numbers.
If you're using ASP.NET 4, there are even better tools available to you
Also if your web services are WCF based, it gets even better Not only do you have very rich tracing, there's also a gui that displays the logs very nicely.
You can try get official IIS Extensions with the Microsoft Web Platform Installer called Web Performance Monitor
Microsoft sells System Center Operation Manager, which has been used by many big firms. But that's too expensive if you cannot afford it.
Web Performance Monitor of course worth a try, and Perfmon is already an option.