I have a MMOG server running on C++, using winsockets. My server won't support more than 200 players. I had the idea of redesigning it so it will use multiple servers instead of one, so, maybe, for example, each server could take care of a number of players, and, if it was too laggy, it could transfer the responsability of that player to other server. I'm not sure of how to program a consistent game logic like that, though. Are there techniques for this?

  • 1
    I think you should be more concerned with taking care of the source of DDOS attacks and removing any vulnerabilities instead of simply adding more power to your system to better handle the attack.
    – Ryathal
    Mar 8, 2012 at 20:41
  • I think the OP mean that only players that want to play cause the DDOS ( Too much players at the same time)
    – Nettogrof
    Mar 8, 2012 at 20:42
  • No, it's maily administrators from competitor servers, and there's nothing I can do against them because it's a sort of underground gaming community. Script kiddies. Also, the server is hosted on my home. I have 3 to 4 internet links at disposal, so, if I manage to make a system wise enough, they'll not be able to nuke my server. They probably won't even figure out why it's not working.
    – Dokkat
    Mar 8, 2012 at 20:47
  • For example, I guess I could make the client start a TCP connection with each one of my servers. The computing can happen on the main server, with the other two serving for internet access. If one of the servers is down, the remaining sends the relevant information. What do you think? Can this work?
    – Dokkat
    Mar 8, 2012 at 20:52
  • 1
    Do you have anything in place to actually handle these DDOS attacks? Or are you just letting your server handle the connections? Mar 8, 2012 at 20:57

3 Answers 3


You have 2 questions here.

The first what do i need to do to convert from a single server to a distributed computing environment?

You need to learn to program distributed computing applications. There are quite a few books on this out there. There are even college classes that teach this skill. Your can find some online classes as well. Once you have learned that you will need to redesign your game to work in a distributed system. Will probably require a nearly complete overhaul of your code.

Second how do I deal with my DDOS attacks from my competitors? This is off topic here but is a good question for IT Security SE


The first thing you must think is about partition. That is, split players in groups that don't usually interact. As much partitions you have you can have more servers (you can read more with PCAM methodology of partitioning http://www.mcs.anl.gov/~itf/dbpp/text/node15.html). On the other hand systems that make thinks like yours usually have their clients connected to more than one server at the same time in order to have a failover (but this is more harder to do).


The first thing you have to do is profile what's making it slow or "laggy". Understand the problem. Is it an OS limitation (too many sockets open)? Is the server using 100% CPU? Is the DDOS flooding the network and slowing it down? If not, can you do any profiling of your code to determine what the current bottlenecks are?

Is your code multi-threaded? If not, and if your game is CPU-bound, a good improvement might be to have multiple threads. This would be the first step towards a distributed system, too. You could have a client handler / connection pooler and a separate thread that represents the game state and takes actions from the handler and applies them. It's difficult to speculate without knowing more about the structure of your program.

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