Results 1 to 6 of 6
  1. #1

    easy to config load balancing/failover script?

    I'm planning on getting inexpensive dedicated hosting from a few providers to help distribute music files for a band.

    I'd like to have a script running on the main server that polls the servers with the music files every minute or so, and then redirects users to the least used server to spread the load. If the remote server doesn't respond, it is taken out of rotation until it comes back up.

    Can anyone suggest a good easy to install/configure script for this application, PHP + mySQL preferred.


  2. #2
    Join Date
    Jul 2005
    Ann Arbor, MI
    The absolute easiest thing to do (that I can think of) would be to use round robin DNS. However, if a server went down it would not be automatically removed from the cluster -- Still, an easy solution to get you up and running.

    I would also recommend checking out MySQL's docs on doing master/slave syncing

  3. #3
    Thanks. Right now I'm likely to use a DNS failover scheme from a DNS provider that will monitor service availability and remove a servers IP if it goes down. It's not great, but its good enough, more or less (better than straight up round-robin DNS). I'd rather have something a little finer grained though.

    I don't actually have any need for mySQL failover. I just was offering it as a potential piece of the infrastructure for maintaining state info on the front end server.

    Anyone else with suggestions?
    Last edited by easman; 07-26-2005 at 11:39 PM.

  4. #4
    Join Date
    Oct 2002
    York, United Kingdom
    You could always use load balancing? If its only for one bands music is there much point enless the band is extremely big such as ---> Linkin Park... etc.......

  5. #5
    adaml, we really don't know how many downloads there will be, or how quickly they will come. The band's first album sold over half a million copies. The second sold far fewer, which isn't exactly suprising since the record company held it up for over a year and then released it with almost no promotion because they were too busy worrying about mergers over music.

    The goal is to deliver as many downloads as possible with reasonable but not necessarily perfect reliability for the lowest cost possible. Being able to use multiple cheap hosts and add more cheap hosts as needed seems like a good way to do that. Some sort of commercial loadbalancer would add significantly to costs and wouldn't necessarily work with hosts placed at multiple providers for variety.

    We don't need Linkin Park (gag) levels of popularity to blow through 4 or 5 TB or transfer in a month.

    Thanks again for the suggestions. Other input is apreciated as well.

  6. #6
    Join Date
    Oct 2002
    York, United Kingdom
    Whats the band ?

    Try or they offer load balancing and should be able to spread the load even with a shared account.

    Failing that you could use php :

    when someone downloads
    - query database
    - check number of current downloads to number of maximum downloads
    - select download mirror with the less amount of current downloads
    - add 1 to the database on the download mirror which is in use

    or find a few mirror sites and use them

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts