Load Balancing...


I am designing a automated sign up process.

Here’s the flow I’m attempting to accompish:

  1. sign up for hosting account.

  2. make payment.

  3. upon payment confirmation (automatic) have my control panel (custom built) poll each of the available servers in the cluster for space, and resources.

  4. once the most appropriate server is located, have that server automatically add the domain to it.

  5. when a customer sets up a second, third, forth, etc server has the same steps followed to load balance the domains across multiple nodes.

*** i’m not attempting during this phase to handle fail over or other types of load balancing. ***


*** these are just the basic steps I’m trying to accomplish. other tasks like geographically locating a website would also be done. ***

*** the problem I’m facing now and need assistance with is the ability to determine which server meets the resource requirements. (memory, disk space, etc) ***

*** migrating domains to other hosts for failover recovery, and further resource balancing has already been taken care of. ***


Well, before you get too far with that, I wanted to make sure you weren’t interested in using WHMCS, which does a lot of that already. You can see it over at whmcs.com, and there’s also an Install Script for that in both Virtualmin GPL and Virtualmin Pro.



I appreciate your suggestion, however I’m building my own in-house solution and simply trying to figure out how to best handle the checking of which server has the lowest load, etc.



That’s unfortunately not part of the Virtualmin API. However, it should be pretty straight forward to build a web-based script hosted on a domain of each of your servers that returns that info.

For example, you could build a PHP script that returns the output of “free -m”, “uptime”, and “df -h”. The application you’re building could then query each of those scripts, and decide which server is best suited for the new site.