Search Unity

Question I got slow with 200 user online

Discussion in 'Unity Transport' started by Farshadmo368, Sep 26, 2023.

  1. Farshadmo368

    Farshadmo368

    Joined:
    Sep 26, 2023
    Posts:
    2
    How many users can you send messages to in each frame? How to increase the number of send to users per frame? I got slow with 200 user online
    Code (CSharp):
    1.   void InitializeServer()
    2.     {
    3.         var NetWorkSetting = new NetworkSettings();
    4.         NetWorkSetting.WithBaselibNetworkInterfaceParameters
    5.             (
    6.              receiveQueueCapacity: 1024,
    7.              sendQueueCapacity: 1024);
    8.         NetWorkSetting.WithFragmentationStageParameters(1000000);
    9.         m_serverDrive = NetworkDriver.Create(NetWorkSetting);
    10.         _reliblePipeline = m_serverDrive.CreatePipeline(typeof(ReliableSequencedPipelineStage));
    11.         _fragmentedPipeline = m_serverDrive.CreatePipeline(typeof(FragmentationPipelineStage), typeof(ReliableSequencedPipelineStage));
    12.  
    13.         var addr = NetworkEndPoint.AnyIpv4;
    14.         addr.Port = serverData.ServerPort;
    15.         if (m_serverDrive.Bind(addr) != 0)
    16.         {
    17.             print("filue bind");
    18.         }
    19.         else
    20.         {
    21.             print("server start");
    22.             m_serverDrive.Listen();
    23.         }
    24.         m_connecsions = new NativeList<NetworkConnection>(serverData.ccu, Allocator.Persistent);
    25.     }
     
  2. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,711
    per frame? ouch thats a lot of network traffic