dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.42k stars 10.01k forks source link

Add diagnostics for memory pool usage in Servers #11400

Open halter73 opened 5 years ago

halter73 commented 5 years ago

Added by @anurse : EventCounters and/or EventSource events.

davidfowl commented 5 years ago

More details

halter73 commented 5 years ago

What details do you want?

halter73 commented 5 years ago

There's really no background. We were talking about things we should add EventCounters for, and triggering an event every time we add a slab to the memory pool seemed like it might be interesting.

davidfowl commented 5 years ago

PS: I think this should be punted.

halter73 commented 5 years ago

I don't feel strongly about it. I mentioned it in standup and @anurse told me to file an issue. It could become more interesting if we decide to start using some more interesting algorithms that might even shrink the pool, but we can cross that bridge if we get there.

analogrelay commented 5 years ago

I don't expect to get to it in 3.0, but I wanted to track it. I'll update the issue to be a little clearer. Adding a new counter isn't a breaking change so it's fine to do it later.

The idea here is to add EventCounters to help track the behavior of the memory pool. When it increases in size, perhaps how many buffers are in use and how many are sitting in the pool. These could all be useful data for tuning our algorithms and for understanding memory usage in customer apps.