icon512 Posted October 28, 2009 Share Posted October 28, 2009 Hello all! I got this through Google searching for PHP load balancing: http://www.daniweb.com/forums/thread171839.html I am trying to do something similar, but what I'm trying to do is a one time, one day, quick and cheap load balancing solution using PHP. The idea is to use a simple php script to randomly redirect users to several other servers with one static page. I am just wondering if this would be sufficient if I were to expect an influx of users for only one day (may reach up to 50,000 users within a one hour period). Below is what I have come up with using only limited php knowledge. The server running this script will be a basic dedicated virtual server by MediaTemple which should suffice as a temporary load balancer, and will be redirected to multiple GridServer accounts from MediaTemple. Do you see any problems with this? <?php $servers = array("www.foo1.com", "www.foo2.com", "www.foo3.com"); $server = $servers[array_rand($servers)]; header("Location: http://$server"); ?> Thank you for taking your time to look at this! I really appreciate it! Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted October 28, 2009 Share Posted October 28, 2009 dude thats prety cool let me think, are all the servers clustered and mirrored, you could do this for your mysql server too Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted October 28, 2009 Share Posted October 28, 2009 get the config file, redesign it, then just replace it, then put the old one back, or build in the timing to last 1 day with one config and then revert Quote Link to comment Share on other sites More sharing options...
icon512 Posted October 29, 2009 Author Share Posted October 29, 2009 I believe all the servers from MediaTemple are clustered, but I could be wrong... Changing the file back will not be a problem as it will only be a temporary, one time thing. Anyone else want to confirm that this is an ok idea? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.