Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. Partitioning servers to CPU cores
  2.  
  3. Unity servers are single-threaded. That means a single Unity server can not use the full power of a multicore processor. A Unity game server will only be able to use one core up to 100% CPU and then the frame rate will decrease.
  4.  
  5. It is normal and OK to run several Unity servers on one core. How much CPU every game server will use is very much depending on gameplay and the number of connected players. It is possible to host hundreds of Unity game servers on a modern 8 core Windows machine, at least if the number of players per server is low (2-4) players. If you do this, make sure the game servers are evenly distributed, resulting in a CPU load on each core at around 80 will be minimal. If one of the cores reaches 100the game servers using this core. Keep the CPU below 100 drops will result in higher server latency addition since it will not be able to handle network input and output at the normal frame rate.
  6.  
  7. This kind of partition among cores can be done very easily with a Windows tool called start. This is a script that starts eight Unity servers, and two of them are dedicated to each core on an 4-core machine.
  8.  
  9. start /affinity 1 test1A.exe -batchmode -port=12001
  10. start /affinity 1 test1B.exe -batchmode -port=12002
  11. start /affinity 2 test1C.exe -batchmode -port=12003
  12. start /affinity 2 test1D.exe -batchmode -port=12004
  13. start /affinity 4 test1E.exe -batchmode -port=12005
  14. start /affinity 4 test1F.exe -batchmode -port=12006
  15. start /affinity 8 test1G.exe -batchmode -port=12007
  16. start /affinity 8 test1H.exe -batchmode -port=12008
  17.  
  18. The affinity option controls which cores the server will be allowed to execute on and can also be changed manually at runtime using the Windows task manager. Just right-click the server process and choose Set Affinity...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement