Search Unity

How to handle 10 million static physicshape Entities in DOST . I can only handle 1 million.

Discussion in 'Physics for ECS' started by niflying, Nov 20, 2021.

  1. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    108
    Hi Guys,
    I want to build a big word with 10 million static physics shape Entities which is on server side no need to be rendered. These entities I need to cast so I have to add physics shape on them. and I got a strange problem:

    When I added 1.1 millions the FPS is about 330 FPS. but on 1.2 millions the FPS downs to 110 FPS. But on 1.3 millions the FPS downs to 3 FPS . please check this out :
    20211120224148.png 20211120224155.png 20211120224201.png

    I test it on 96 cpus cloud server.

    and this is how I handle that.

    I created a gameobject with Physics Shape.

    20211120224620.png

    and Instantiate them in Start()

    Code (CSharp):
    1.    for (int i = 0; i < maxCount; i++)
    2.         {
    3.             GameObject go = Instantiate(obj);
    4.             go.AddComponent<ConvertToEntity>();
    5.         }
    then I build a Dedicated Server for ubuntu.

    Anyone has some ideas for this ?

    Thank you very much.
     
    Last edited: Nov 20, 2021
  2. I have never played with DOTS on this scale, so I'm just guessing here, but when the performance dips this abruptly, it often mean you're running out of memory and start to swap. Have you checked your memory consumption?
     
    neginfinity likes this.
  3. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    108
    Yes I checked the memory there are about 90G free only used about 6G.
     
  4. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    108
    BuildPhysicWorld takes a lot of time.
    20211120233316.png
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Moved to correct forum.
     
  6. papopov

    papopov

    Joined:
    Jun 29, 2020
    Posts:
    32
    Seems interesting!
    Can you provide a screenshot of the Unity Profiler of BuildPhysicsWorld and it's jobs (at 1 million and 1.1 million cases), and then we can discuss more about what could have gone wrong?