Load Balancing / Distribution

Discussion in 'Site & Server Administration' started by Kalyse, May 27, 2007.

  1. #1
    Hello,
    When do you start to become concerned with Load balancing / distrubution?
    I am just wondering how many concurrent PHP/MySQL users before you start to need to setup a cluster of apache or some other distribution and what kind you use?

    What is a good 'typology'. Please approach this site/network as if it will have a hypothetical 10k concurrent users. All users need to hit the same script but it will have multiple domains. (Ill explain now)

    Can people input there thoughts on this coding/layout:

    Multiple domains all setup with A records on DNS Round robin that all point to the same 3 IPs.
    ie.
    [Site.com]
    site.com 60 IN A 192.168.1.1
    site.com 60 IN A 192.168.1.2
    site.com 60 IN A 192.168.1.3

    [Site2.com]
    site2.com 60 IN A 192.168.1.1
    site2.com 60 IN A 192.168.1.2
    site2.com 60 IN A 192.168.1.3

    [Site3.com]
    site3.com 60 IN A 192.168.1.1
    site3.com 60 IN A 192.168.1.2
    site3.com 60 IN A 192.168.1.3


    Each of these servers will then be visited in roundrobin. The DNS server will take a big whack but there is no other way around this is there?

    Then upon visiting the server the user will hit the primary server. There will be an Apache cluster (how many should this be, is this even the correct move) to make sure that there is a backup incase that server is unreachable?

    Then I will have a cluster of 3 dedicated mysql servers.

    Overall, there would be 10 servers if I have worked this out correctly (but I havent done apache clustering before so I dont even know if its possible with only 2)
    1 DNS
    3 Primary Apache - 3 Backup Apache
    3 mySQL Servers


    Now for the actual site.

    Each domain pointing to the same IP, will then be read by a PHP script which picks up the HTTP_HOST which then reads the mySQL database to feed information about that site into the page.

    I am not sure if this is thebest way of doing it, but to ensure that sites can be added within seconds and will be manageable all through the same control panel and have the same template, this was the best way I could think of, and allow for thousands of simoustanous connections.

    Any thoughts?
     
    Kalyse, May 27, 2007 IP
  2. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Better if you ask the DC to do that. Load Balancing isnt that easy and results often in something wrong:confused:

    They'll take a setup fee of $300-$800
     
    inworx, May 28, 2007 IP
  3. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thats why I said distribution / balancing.

    Distribution would work just as good.

    On top of this, heres the catch. Im (in the future) Going to be be using multiple datacenters.

    Also, I just realised, if all my domains are using the same IP, thats quite a bad way of doing it isnt it, since all the sites will be regarded as the same and will probably loose SEO.

    I think I will need to make sure that each site uses diffeent IPs again.
    so 3 sites (3 domains) 9 IPs

    Has anyone else got any useful feedback I can use.
     
    Kalyse, May 28, 2007 IP
  4. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What load balancing software do other people use for mysql and http?
     
    Kalyse, May 28, 2007 IP
  5. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I recommend you go with Load Balancing switch. Softwares arent that useful.
     
    inworx, May 30, 2007 IP
  6. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you have some links to that which you recommend it would be good. Im already happy with what I use though so just adding a balancer wuld be prefered.
     
    Kalyse, May 30, 2007 IP
  7. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Its the thing you need to ask the DataCenter...
     
    inworx, May 31, 2007 IP