views:

137

answers:

1

I have two backend applications which provide the same functions and they are located on two separate machines (actually this is to make a load balance). So they handle the client frontend requests using the same manner.

I want to collect some statistics about all the clients connected (i.e: what is the most used component in the client GUI application or something like that) and send the result to all clients every second.

I am thinking about calculate these statistics on each backend component separately and sum both together in that case I have set of options like make some sort of communication between backend components, or simply make small table in global DB and each backend update the table then select and send to its clients but this may decrease the performance as I want to send the statistics every second

I need a help

A: 

I'd need proof that an arbitrary (or random) assignment wasn't good enough before I'd invest a more complex solution. Keep statistics on each machine and compare their load factors based on some arbitrary assignment (current second is odd, choose machine 1, second is even, choose 2) first. If that isn't working, then you can start looking at a better algorithm.

FWIW, this is exactly how we assign default printers in our computing labs on campus for 1000+ machines. Our load across the various printers in each lab are evenly distributed.

tvanfosson