Search Unity

batchmode multiple server instances

Discussion in 'Multiplayer' started by Djik, Sep 3, 2010.

  1. Djik

    Djik

    Joined:
    Jul 13, 2010
    Posts:
    19
    Hello,

    I'm trying to run serverals server instances in batchmode on windows.

    It appears that when I execute more than 1 server instance, all other instances doesn't seem to execute their flow.

    If I run them in "normal mode" with rendering/input, everything goes fine but once i run them in batchmode, only one instance is processing.

    Any idea?
     
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    are they all running on different ports ?
     
  3. Djik

    Djik

    Joined:
    Jul 13, 2010
    Posts:
    19
    Yes they Do.

    In fact, if I launch 2 instances of the server (with different ports) in batchmode, In the windows task manager, only the first instance is using CPU (about 50% due to dual core), the other one takes 0%.

    When I launch theses 2 instances without batchmode (so with rendering process), in the task manager, one instance is using CPU at about 30% and the other at 20%.

    The result in batchmode is that the client cannot switch from 1 instance to another because the second instance cannot process client connection.
     
  4. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    did you enable 'Run in background' under Edit/Project Settings/Player ?
     
  5. Djik

    Djik

    Joined:
    Jul 13, 2010
    Posts:
    19
    Yes I did, that's why everything goes fine in "normal" mode, but why doesn't it work in batchmode ? -_-
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    it does work in batchmode, we have multiple ones running in parallel, during testing it were over a dozen.

    likely you don't have code that handles the situation without a user giving input correctly or an endless loop which eats 100% cpu time
     
  7. Djik

    Djik

    Joined:
    Jul 13, 2010
    Posts:
    19
    Thanks to you! I could solve the problem.
    It was the Camera Gameobject that was enabled in server build and then was eating all the CPU. When I disabled it, everything worked.

    I'm still curious why the camera component give this behaviour in batchmode. Thought it was skipped.
     
  8. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    are you on v2.6.1 or one of the betas ?
     
  9. Djik

    Djik

    Joined:
    Jul 13, 2010
    Posts:
    19
    We're using v2.6.1