Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Single-Core vs. Multi-Core for Unity Game Servers

Discussion in 'Multiplayer' started by jashan, Oct 3, 2008.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I was wondering whether I should get another dedicated server for Traces of Illumination with a single-core or multi-core processor. According to my tests so far, and e.g.

    http://forum.unity3d.com/viewtopic.php?t=12184

    Unity doesn't really make use of multiple cores, so my feeling would be that a fast single-core system would be a better server-hardware platform for a Unity game server than a slower multicore system.

    I'm comparing, for instance an Intel Pentium 4 2.6 GHz with an Intel Core2Duo 2 x 1.8 Ghz. The nice thing about the Intel Pentium 4 would be that it's also about 30% cheaper (so I could get more machines when there's more players). And, I would think that it would be quite a bit faster (as there's no rendering on a game-server, I'd assume that processor speed is the most significant variable; aside of networking, of course ;-) ).

    The OS would be Windows, and there would be no other services running on the machine.

    Any insights on this?
     
  2. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    I've mentioned something along this line in the past with regards to threading and multiple processors. I ran into a brick wall and just assumed it was completely me (and I will stick with it just being me). On the iMac, Unity appears to run properly using multiple processors/cores, but on Windows, all my tests show that it runs on a single processor/core, but I have a Pentium D that I am testing with that is like 4 years old now. I plan on replacing that machine around christmas or so with a dual processor quad core box then restesting.

    What I discovered is that which ever processor Unity starts up on, is the processor it stays running on with all of its child threads (for some bizzar reason, the other threads do not start on the other processor, ever).

    Unity will probably start up on a single core in one of the processors and all threads with regards to Unity will be ultimately starting up on the same core. Meaning that for some odd reason, all cores show almost 0% utilization and one core is pegged at 100%.

    I seriously doubt this is a Unity problem at all. I have leaned towards OS issues, but the test is consistant between Windows XP Pro SP2, through to Vista Ultimate. Mind you, same box, just did OS upgrade to see if it helped.

    It is a problem, just don't know on what scale, if any scale.
     
  3. jeffcraighead

    jeffcraighead

    Joined:
    Nov 15, 2006
    Posts:
    740
    I'm pretty sure that is an issue with the Windows scheduler. It will only put separate processes on different cores, not threads.
     
  4. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    From my most recent tests, there doesn't seem to be problem with the scheduler on multicore-windows machines. However, there seems to be a serious problem with single-core machines for game servers ;-)

    With a single-core machine, Pentium 4 2,6 GHz, even playing with 20 players simultanuously results in very odd behavior, with the server seemingly not really reacting anymore. It did recover after all game sessions were over, but 20 players giving us trouble really was not fun ;-)

    With the AMD Opteron 1212 based machine I had used as server for the previous tests, things become odd at around 60-80 clients playing simultanuously. At 85 clients, both cores are pretty much "saturated" with work and the "framerate" on the server really went down ... I've seen something around 25 in "short term average", but the logged minimum was 3 FPS (that was with all 5 game groups playing in the third level at the same time) ;-)

    The OS was Windows 2003 Server Web Edition on both machines.

    Since around 100 clients is also the limit of what I'm currently able to simulate (with around 15 machines hosting the load-tester clients, distributed on 3 locations), I'll leave it at that for now. I guess with more powerful server-machines (the AMD Opteron 1212 is a EUR 69/month machine), more than 100 clients should also work, but I guess for my purposes, I'll rather get more machines than fewer more powerful machines ...