AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

Is it a good practice uses the InMemory.Storage in a production environment?

Open MatheusXavier opened this issue 4 years ago • 3 comments

I'm using the Health Checks UI in a container with the InMemory.Storage and I'm not sure about how much memory it uses. Is it a good practice uses the InMemory.Storage in a production environment? Or this could be a bad choice because the container can demands a lot resources?

PS.: I'm opening this issue because I read the documentation and didn't see any topics talking about that.

MatheusXavier avatar May 26 '21 21:05 MatheusXavier

Unless you have a huge amount (read dozens or hundreds) of endpoints you're monitoring in combination with these endpoints changing state very often, I can't imagine that memory consumption should be noticeably high. You obviously lose the state history when the UI gets restarted, but this seems not to be a concern for you. Just let it run for a couple of days/weeks and observe your memory consumption. If concerned or if it turns out to be an issue, you could schedule regular restarts of your front end to clear the state.

devax avatar Jul 22 '21 08:07 devax

Do you have any experience to share, now that you've been running in production for a while? I'm also interested in this.

The key question is how many events are stored in the in-memory provider? Is there a way to limit to say, 100 events, or are ALL events stored forever?

Any advice would be appreciated!

lonix1 avatar Jun 19 '22 02:06 lonix1

We are currently monitoring only 7 services and they rarely change their status so there is not much data to save and when you do a new deploy basically reset those statuses helping this resource consumption too, so far we haven't had any problem using the InMemory approach.

I saw that when you are using the database approach you can configure how many events you want to show on the dashboard, this can help performance but I don't know if there is a configuration of how many events are stored in the in-memory provider.

MatheusXavier avatar Sep 05 '22 11:09 MatheusXavier

Closing as answered.

sungam3r avatar Jul 22 '23 08:07 sungam3r