Jump to content
  • Advertisement
Sign in to follow this  
Drethon

Whats the best way to handle multiple servers?

This topic is 5057 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm curious about what is the accepted best way to handle multiple servers with a multi-player game? What I think of for this is all data from the clients is stored into one buffer then another process sends the data to the specific server that the data is meant for. The problem I have with this method is all communications are handled by a single process, possibly bogging down the system. Though this may not be a problem since redirecting the data packets to the correct server probably uses less processing than the work the server on the end has to do. Any thoughts?

Share this post


Link to post
Share on other sites
Advertisement
Up to a few thousand players, a gateway machine would probably be fine.

After that, you have to have the clients re-connect directly to the different servers, or to different gatekeepers for different servers. It should be noted that EverQuest did this already back in 2000.

One problem you'll have to solve is how to log in with username and password and authenticate only once, rather than having to re-authenticate with each server you connect to. I have a brief overview on my website that might help.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Latency comes in many separate stages, and a gateway will increas one of those stages. However, it's usually one of the smallest (or even the very smallest, if you're clever with your network design). Of course, several professional MMOG developers have been stupid and implemented naive gateways, which has helped earn them a bad name in some circles. Sigh.

An example latency path:

PC to cable modem: 0.5 ms
modem to ISP: 2 ms
ISP to MMOG (gateway) : 40ms
MMOG (gateway) to MMOG (other server) : 0.3 ms
MMOG (other server) parsing time: 0.1 ms
MMOG (other server) processing time: 4 ms
MMOG (other server) queue delay: 16 ms
MMOG (other server) compile + transmit response: 0.1 ms
return path all the way to PC: 42 ms

total = 105 ms
total added by gateway = 0.3 ms

Cluster-performance-design 101: never pre-empt the bottlenecks by saying "isn't X slow?". Always do the maths, and calculate the actual effect of X compared to the rest of the system :).

e.g. even if your gateway does it's own fat protocol processing, and takes a monumental 5 ms about it, the effect on the overall latency is indistinguishable.

PS: of course those figures are off the top of my head. Don't rely on them. They're approximately correct given all sorts of assumptions about the actual game design etc.

redmilamber

Share this post


Link to post
Share on other sites
You forgot one other big source of latency: The latency between the user pressing the key, and the program reading the key and queuing a network command, and the program actually coalescing network commands into packets. If your packet rate is 20 per second, that's 50 milliseconds max (25 average).

Btw: The latency between the modem and the actual Internet POP for your ISP is likely to be higher than 2 milliseconds.

Share this post


Link to post
Share on other sites
You can't go state-to-state in 0.3 milliseconds. The speed of light is slower than that!

If you have multiple server clusters in different geographic locations, and use gateways, I would recommend putting one gateway at each cluster, to avoid having to forward interactive data between geographically dispersed clusters.

Share this post


Link to post
Share on other sites
crap.. the speed of light is slower then that? so i guess we will never truly have a 0 ping system then, huh? how great it would be if we didnt have to worry about latency. throw in an infinite bandwith connection and remove the world of all cheaters and you have reached network programming heaven [grin].

actually, forget that. half the fun is dealing with this stuff [smile].

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by hplus0603
You forgot one other big source of latency: The latency between the user pressing the key, and the program reading the key and queuing a network command, and the program actually coalescing network commands into packets. If your packet rate is 20 per second, that's 50 milliseconds max (25 average).


:) very good point. I'm too accustomed to doing FPS designs, where the rule of thumbs are all measured in RTT from "message starts to be transmitted from client's NIC" until "message received at client NIC".

Quote:

Btw: The latency between the modem and the actual Internet POP for your ISP is likely to be higher than 2 milliseconds.


I was going for a lower bound there, to minimize the total latency calc, since it seems to depend a great deal on geographic location. Here in the UK a lot of broadband is at that level. I've had two providers in a row who have consistently been sub-5-milliseconds. Where I am today (out in the middle of rural england, no more than 5 houses within 5 miles of me) I'm getting 15 ms.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by hplus0603
You can't go state-to-state in 0.3 milliseconds. The speed of light is slower than that!


Exactly...I thought it would be obvious that a sub-1-ms time was going to have to be on a local LAN :). So, as hplus suggests, I was assuming that you had a gateway per geoggraphically located cluster (IMHO anything else is insane, in this context. You can have a front-end that lets the user select a gateway, which is itself a sort-of-pseudo-gateway (it might automatically redirect to a gateway based on netblock of client, for instnace), but as far as these low-level gatewaus go they HAVE to sit in their cluster).

@ graveyard:

ping time for light to cross atlantic ocean == 40 ms (20 + 20).

However...there are ways of going much faster than light. There is a quantum system that has been demonstrated to transfer information much faster (reasonably well accepted) and another that seems to suggest actual matter travelled faster than light (not so well accepted).

It is not unreasonable to expect that a quantum connection will eventually be setup across each inter-continent link. "Eventually" could well be 50 years away.

There are 3 invariants in the world of computers:
- latency never decreases (compared to bandwidth and processing power)
- batteries never get smaller (compared to microchips)
- power cannot be supplied wirelessly (without frying every poor soul who walks through the space the power is moving through)

All could be beaten some day, but have held true for almost as long as Moore's law. Look at hard-disk latencies today and compare them to 10 years ago. Do the same for transfer rates :). Ditto with networking. Ditto with system bus etc.

redmilamber

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!