Last post Jun 02, 2017 09:51 AM by EvenMa
May 30, 2017 03:32 PM|Underground|LINK
I have a Windows service that is self hosting SignalR and WebAPI using OWIN. This is a very simple example, runs fine, serves requests, great.
I noticed though that for some reason, the service will suddenly go from 1-2% CPU usage to 12-13%. For no apparent reason. Even when there are no requests against it, suddenly it will just jump up and stay there for a while. Then just as inexplicably
drop back down eventually. It will go back and forth if I watch it long enough.
Making calls against it doesn't force the CPU usage up, it seems unaffected by that whether high or low, and it continues to operate just fine throughout this.
SignalR would be my first guess as the most likely to have something going in the background. Does anyone have an idea what might be causing this? 10% of the CPU is a pretty good sized chunk for something to take.
May 31, 2017 06:43 AM|EvenMa|LINK
You couldn’t worried about it.
When the service is running, SignalR need to do more operations, such as listen on the endpoint, accept the clients connection, receive from clients, send to clients, check whether the connection connected and so on ,and also with the increase of the client,
the CPU usage will also increase.
In your case, it only takes under 15% CPU usage, and it doesn’t always consume more CPU, that’s a normal situation.
If you have any other questions, please feel free to contact me any time.
May 31, 2017 01:15 PM|Underground|LINK
Of course, but it's doing that all just fine at 2% usage. And there are 0 clients when this occurs, so it's definitely not load related.
If it was momentary I might understand, but it will hit 12-13% usage and stay there for a while. That's a big jump for no apparent reason.
Jun 02, 2017 09:51 AM|EvenMa|LINK
Even if there is no client, SignalR still needs to work，it needs to listen on the endpoint to accept client connection at all time, that will takes some not fixed CPU usage.
For more details about how SignalR works,you could refer to the following link: