I writing this as I have run into a dilemma that I cannot readily answer.
Specifically, how many threads is too many?
- Writing a game (Surprise.)
- C++11, all server-side bits running on Linux server installs (headless)
- Login server and chat server are on a single server
- Database server/processing is its own server (eventually)
- The world server is the 'master' server, in which zone 'servers' (threads) are spun up. Each zone 'server' is responsible for a specific planet and all that entails (npcs, entity lists, etc).
With that brief intro, is there a point in which there are too many threads? Assuming there are 10 planets (zone "servers"), each with their own thread, would there be any extreme problems (not performance bottlenecks) that need to be accounted for in this type of situation utilizing an 8 core server? Would the same problem persist at 16 cores?
The end goal would be to allow for up to three "instances" of each planet, with maybe 20 planets (~60 threads) in the end. I understand that this could cause CPU contention as each thread is waiting for CPU cycles, but not enough to effectively hang the system (excluding a zone server locking up). If the game progresses to that point, 32 core servers would be an (expensive) option.
Is there anything that I am missing or not understanding?
Thank you in advance!