Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In a current project of mine, a portion of my website is expected to receive a very large number of visitors. It would basically be an online game with a large number of players playing simultaneously. So I would like to have it on a separate server. However, I would like to use the same domain name for the game. Is it possible to associate the same domain name with two different servers?

On a different note, is there any other solution to the above problem ?

share|improve this question

migrated from stackoverflow.com Jul 30 '11 at 16:43

This question came from our site for professional and enthusiast programmers.

    
Yes. (Hint: www.amazon.com is run by more than one PC in a closet!) Google for the term "Load Balancing" for a complete response. –  Bob Kaufman Jul 30 '11 at 15:27

3 Answers 3

Yes, there's a few ways to do this. You have to have a unique machine name for each one (which will look like a subdomain) but you can use load balancing to have a virtual IP that is associated with the root domain.

That said, if you can't or don't want to pay for a load balancer, you can do something similar in your app logic, where you have one front-end server (your root domain) which assigns players to a game server when they login (so, user logs into the game at yourdomain.com but then when they start playing, your app redirects them to server1.yourdomain.com).

Depending on what you're developing in, you could also consider looking at cloud hosting services such as Heroku or AppHarbor, which handle some of the scaling for you.

share|improve this answer

You need to consider at what level 'more than one server' is handling the domain.

Presumably >1 nameserver is handling DNS resolution so we'll skip that.

You can have more than one IP address for a given A/AAAA record. This is the simplest form of load balancing. Run: 'host www.google.com' to see an example.

Each IP address can be handled by more than one location on the Internet. This called anycast and is what several root DNS servers do for load balancing + redundancy.

At the actual IP endpoint, a load balancer can take requests and farm them out to multiple backend servers which handle the actual work of processing the request.

Extremely large sites will use some or all of these techniques concurrently.

In your case, you'll want to have the actual game run on a separate (or multiple separate) hostname in the domain. Some sort of front end on login/etc will direct the browser to the appropriate server for that user in that case.

share|improve this answer

IF you are using Apache, this is a pretty good guide http://wiki.magnolia-cms.com/display/WIKI/Guide+-+How+to+configure+an+apache+load+balancer

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.