0

Think of a load balancer which is to balance the load according to the available (remaining) processing power of its units. How would you calculate this parameter to compare?

I'm trying to implement this in C# and so far I can query the CPU usage in percentage but that doesn't do since different machines might be using different processors. Perhaps if I could find out the processing power of each machine multiplied by its free CPU percentage, it would be a good estimate.

But what are the important parameters of a processor to include and how to aggregate them into one single number?

Mehran
  • 15,593
  • 27
  • 122
  • 221
  • Don't just look at CPU... also combine it with % Disk total and % User Total. – Moo-Juice Sep 09 '13 at 15:45
  • I'm trying to balance a CPU consuming traffic, % Disk is not important and % User is easily achieved since I can count them in my application. But thanks for the advise. – Mehran Sep 09 '13 at 15:52
  • That machines have different cpus doesn't matter. The slower one will simply take more time to get a job done, thus have a higher cpu usage. – Hans Passant Sep 09 '13 at 16:00
  • @HansPassant I think you are wrong! Having 21% free on a 500MHz is much less power than 20% on a 1600MHz, don't you think? I haven't included cores yet!! – Mehran Sep 09 '13 at 16:04
  • It is automatic. Routing a job to the slow machine will keep it at the higher percentage longer. Thus automatically leave it unbothered for a while. But what the hey, why don't you just program it your way? Use System.Management to find out what kind of cpu these machines have. – Hans Passant Sep 09 '13 at 16:11
  • Converting the kind of CPU to a number which can be compared fairly is my question. – Mehran Sep 09 '13 at 16:15

0 Answers0