Search Unity

Question Receive queue is full, some packets could be dropped, consider increase its size (64)

Discussion in 'NetCode for ECS' started by Occuros, Aug 19, 2023.

  1. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    300
    After a while of playing the application, we receive the following error:

    `Receive queue is full, some packets could be dropped, consider increasing its size (64)`

    Then the whole server is crashing and requires a restart.

    We are using the latest release of Netcode on a Linux server (dedicated server build).


    Is there any way how we can investigate this? as it happens randomly without any prior errors on the server.
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    896
    Client side or server side?
    Usually this can happen when you either receving too many or sending too many packets, so the default 64 available in the queue are not sufficient to dispatch all the pending messages.
    How many players are connected ? You can expect 1 rpc packet + 1 snapshot packet per client (on the server) on average. In case of reliable messages this can go up quite a bit (so RPC, because of the re-send mechanism). Same goes for unreliable-fragmented pipeline, that cam produce more packet.

    Usually 64 are ok for low number players, but with more than 16/20 this setting is too low. Unfortunately you need to create a custom bootstrap to bump this value up. the default for Transport is 256, that is good default. That has been changed recently but in net code we were (are) still using 64. We should upgrade that.
     
    Occuros, NikiWalker and optimise like this.
  3. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    I'm concerned about this part. Do you have more details about the crash?

    Normally this log message only indicates that the entire receive queue was filled by a transport receive job, which usually implies that we received more packets than we were able to process. But most of the time I'd expect these extra packets to hang around in OS buffers until the next receive job. So I'd expect this log message to show up along with increased latency, but not with crashes.
     
  4. skwoods98

    skwoods98

    Joined:
    Mar 18, 2019
    Posts:
    7
    Seeing this too - Unity 2023.1.17f1, Netcode 1.6, Unity Transport 2.0.2. (although I've been seeing this for a few version, so it's not a recent thing) It happens on the client. This is just a single player (WebGL) and a host (development environment) and it happens within a minute or so. That forces a client disconnect and the host throws this error:
    Error sending message: Connection state is invalid. Likely caused by sending on connection 4294967000 which is stale or still connecting.
     
  5. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    896
    mmm.. connection 4294967000 suggest the id is not set (seems -1) or anyway it looks kinda wrong.
    Being WebGL you are using WebSocket on the client, Just to be sure: did you initialise the server using a custom driver constructor that also uses websocket ?
    That apart, @skwookds98, do you have a simple repro for this? Or could you please open a case ?
     
  6. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    @skwoods98 I think you may have posted on the wrong forum. This is the section for Netcode for Entities, and it looks like you are using Netcode for GameObjects. The section for that is over here.