unosquare / embedio

A tiny, cross-platform, module based web server for .NET
http://unosquare.github.io/embedio
Other
1.46k stars 176 forks source link

CPU usage spike with EmbedIO #481

Closed deepgoyal25 closed 3 years ago

deepgoyal25 commented 4 years ago

Describe the bug We have started noticing CPU usage spike for our Windows and Mac users after we started using EmbedIO to host http server in our native application. On Mac, the CPU usage spike is easily reproducible. We see an uptick of up to 4% CPU usage spike just by starting Http server with EmbedIO during application start. The CPU usage stays at 4% all the time even when we are not sending any calls to the http server.

To Reproduce Steps to reproduce the behavior: We are using the below code in our application to start http server: - WebServer webServer = new WebServer(options => options.WithUrlPrefix(baseAddress).WithMode(HttpListenerMode.EmbedIO)).WithWebApi("/", m => m.RegisterController < MainModule >()); webServer.Start();

Expected behavior CPU usage should not stay constantly at 4% when server is not serving any requests

Desktop (please complete the following information):

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

deepgoyal25 commented 4 years ago

Any updates on the reported issue

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

rdeago commented 3 years ago

Hello @deepgoyal25, thanks for using EmbedIO! Also, apologies for taking all this time to reply.

Do you know of any way to reliably reproduce the issue either on Windows or on Linux? If not, I'll need your help to do some testing on a Mac, especially if you can use a profiler.

deepgoyal25 commented 3 years ago

Hi @rdeago, thanks for getting back on this issue. I am not able to reproduce this issue on Windows and Linux. I am happy to help out with investigation. Let me know the steps that I need to try out

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.