Yeah, unfortunately, I saw this in production, or I should say validation.
I set up two gearman-servers on two server machines respectively, let 80 worker instances run on each server machine, but let all of the 160 workers register on both gearman-servers.
So basically, gearman-servers can schedule jobs to all 160 workers.
I created 80 clients and ask them to send requests to both servers, and monitored each server to see how they respond to requests.
I did this test over 10 times, and I always saw unbalanced job dispatching, approximate distribution values are about 30% and 70% over two servers.
Gearman does solve most of my problems, and that's the primary reason I'm inclined to use it in production, but I really cannot find a clear description/document about how it achieves 'load balancing'.
To me, CPU load balancing problem itself is a difficult problem to tackle, and I want gearman to help me addressing it. I'm lazy to design the algorithm and code it up.
Any tips, tricks, tweeks to help achieving a better 'load balancing' would be appreciated!
Thanks,
Yang