RabbitMQ .NET Core Client ManualResetEventSlim.Wait consuming a lot of cpu

228 views Asked by At

I'm debugging a .net core 6 app in a docker container (I've used dotnet-trace tool) and I've notice that it gives me 30% oc cpu usage in the wait method of ManualResetEventSlim class used by the rabbitMQ.Client for .net core.

My question is how is that a "wait" is consuming a lot of cpu while it's doing "nothing", just waiting.

enter image description here

Can anyone help me understand what is happening under the hood with this "wait"? I've notice the same thing with the Hangfire postgress client

enter image description here

Most of the time spend on the WaitMultiple method, consuming cpu while waiting.

I understand the part where it's an infinite loop (while true maybe) like a web server that it's waiting for requests to be processed, what I don't understand is the cpu consumption.

0

There are 0 answers