Strangely enough I'm going to be testing load balancing next week
across physical servers as I have provisioned another server last week
for the staging environment to test this out.
In our case the workers get tied up as they are contacting website
services which sometimes can be really slow (up to 120 seconds)
causing the load balancers queue to grow. My idea with the load
balancer was so I can spin up a new worker process when the queue
becomes too large, which is what I can do currently and it works
perfectly, it's just that the load balancer is consuming more
resources than it needs to while the machine is really not under any
other stress.
I've just done some quick profile and all the action seems to be
called from AbstractMsmqListener.PeekMessageOnBackgroundThread. It
spends 53% of its time in calls to
MsmqLoadBalancer.HandlePeekedMessage and it's children with the
remaining 47% in AbstractMsmqListener.TryPeek and it's children.
So over a total period of 4 minutes RSB consumed 183 seconds out of
240 seconds of CPU time excluding my app's time. Which I think is a
bit excessive particularly since it peeked at 226130 messages.
Shouldn't the load balancer pause for a second if it failed to get in
contact with any of the workers, instead of just blindly retrying?
Here are the top offenders in csv format - if you want I can email you
a full csv (it's actually tab delimited) or a pdf.
Total Time with children (ms), Average Time with children (ms), Total
for self (ms), Average for self (ms), Calls, Method name
+183366,0.8,11384,0.1,226122,Rhino.ServiceBus.LoadBalancer.MsmqLoadBalancer.HandlePeekedMessage(Rhino.ServiceBus.Msmq.OpenedQueue,System.Messaging.Message)
+160651,0.7,4743,0,226130,Rhino.ServiceBus.Msmq.AbstractMsmqListener.TryPeek(Rhino.ServiceBus.Msmq.OpenedQueue,System.Messaging.Message&)
+155724,0.7,155724,0.7,226130,Rhino.ServiceBus.Msmq.OpenedQueue.Peek(System.TimeSpan)
+134270,0.6,134138,0.6,226125,Rhino.ServiceBus.Msmq.OpenedQueue.TryGetMessageFromQueue(System.String)29787,0.2,1159,0,180430,Rhino.ServiceBus.LoadBalancer.MsmqLoadBalancer.HandleStandardMessage(Rhino.ServiceBus.Msmq.OpenedQueue,System.Messaging.Message)28569,0.2,28546,0.2,180430,Rhino.ServiceBus.Msmq.OpenedQueue.Send(System.Messaging.Message)7759,0,1312,0,180432,Rhino.ServiceBus.LoadBalancer.MsmqLoadBalancer.PersistEndpoint(Rhino.ServiceBus.Msmq.OpenedQueue,System.Messaging.Message)3825,0,3825,0,180432,Rhino.ServiceBus.Msmq.MsmqUtil.GetQueueUri(System.Messaging.MessageQueue)2622,0,2622,0,180431,Rhino.ServiceBus.DataStructures.Set`1.Add(T)
On Nov 16, 4:39 pm, Corey Kaylor <
co...@kaylors.net> wrote:
> I am happy to take any form of contribution you can offer.
>
> By adding additional worker endpoints I mean.
>
> Load Balancer 1, 5 threads, deployed to MachineA
> 1 worker endpoint, configured to send to Machine1\queue1.readyforwork, 5
> threads, deployed to NewMachineB
> 2 worker endpoint, configured to send to Machine1\queue1.readyforwork, 5
> threads, deployed to NewMachineC
>
> Load balancing although completely *possible* to run on one machine, was
> designed to distribute load to multiple machines. You're not gaining any
> benefits from load balancing when there is only one worker sending ready
> for work messages to the load balancer. You would be better off in this
> case just having two endpoints without load balancing.
>