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

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.

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.

3 Likes

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.

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.

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 ?

@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.