We have web Application built in AngularJS, ReBus and NHibernate. While working on Performance optimization, REDGATE's ANTS Profiler shows that most of the time required to execute MessageQueue.StaleSafeReceiveMessage
And Call Graph will look like this,
So does Message queue taking more time, Why this behavior is observed, what will be the possible options to make this time less or so. Note: I have not added code because for all scenarios, only this part taking 90% time.
I am guessing that what you are observing is the fact that the worker thread is BLOCKED for a small duration, while it is waiting for the next message to become available.
If the queue always has messages in it, I suspect the time spent in
StaleSafeReceiveMessage
will be greatly diminished.In other words, I don't think it is a problem at all :)