Xabaril / AspNetCore.Diagnostics.HealthChecks

Enterprise HealthChecks for ASP.NET Core Diagnostics Package
Apache License 2.0
3.98k stars 770 forks source link

High Network usage - SqlServer storage #2240

Closed dbarwikowski closed 2 weeks ago

dbarwikowski commented 2 weeks ago

Please, fill the following sections to help us fix the issue

What happened: I've noticed that my application is using ~20MB/s of network bandwidth. It pulls tons of data from sql server DB. Not sure why it needs to pull so much data every second. After changing from SqlServerStorage to SqliteStorage problem disappeared.

What you expected to happen: I have 10s delay between healthchecks. I would assume, that reads/writes would happen less often.

How to reproduce it (as minimally and precisely as possible):

Source code sample:

            services.AddHealthChecksUI(setup => {
                setup.SetHeaderText($"Health of [{Environment.MachineName}]");
                setup.AddHealthCheckEndpoint($"{Environment.MachineName}", $"http://{Environment.MachineName}/MyAPI/healthz");
            })
                //.AddSqlServerStorage(configuration.GetConnectionString("dbConnection"));
                .AddSqliteStorage($"Data Source=HealthChecksUI.db");

Anything else we need to know?: HealthChecks-UI and tested application are the same application.

Environment:

dbarwikowski commented 2 weeks ago

On the same server we have other .net applications and their network usage is 50x smaller.

dbarwikowski commented 2 weeks ago

Server setup causes this behavior - cannot reproduce on other devices