Failed to send internal buffer channel:1 bytesToSend:21

hi, my game was working fine up until few days back,there was no laggs no error, but since few days i am facing heavy lagg ingame and i keep getting this error when ever i move or rotate, basically its the network transform, i tried to reduce the send rate to 9 from 16, the error stil persists.

So the actual issue here is the “Send Error: NoResources channel:1 bytesToSend:22” part. I’ve been unable to determine exactly what the “NoResource” error means, because the few times that I’ve seen it, the machine running the server has always appeared to have more than enough cpu and ram.

However, after I spent some time optimizing my game (particularly the physics of the game, which was eating up a lot of cpu, but never maxing it), I haven’t seen the “NoResource” error. So my guess is that there is some sort of internal buffer or limit based on a fixed value (likely hard-coded into the internals of unet), rather than being based on the actual available system resources. This is only a guess though, it could be that there is a setting somewhere within the ConnectionConfig, GlobalConfig, HostTopology or even in the NetworkConnection’s channel settings that may help you to avoid this error.

Sorry for the vagueness of this answer. Maybe someone from unity can give us more info on the NoResource error (i’ve asked before but so far: nothing). Failing that, reducing the overall system resources that your server-side requires may work as it did for me.

Solved: i had usewebsocket true,changed it to false and changed few settings

turning it off kinda solved it.

yes i tweaked some of the manager settings

Interesting, so it may be that the NoResource error is related to the queuing up of messages growing too large, rather than there being a lack of resources (as the error would suggest). I’d be cautious though of relying on your current solution, because what you’ve done is effectively allow messages to pile up more.

If your messages are piling up at all it’s either because your messages are quite large in size (in which case you should look at sending less data in each message, for example, only send values that have changed since the last message), or that messages are going into the queue faster than they are being processed out. Sometimes this can be caused by lagg or cpu spikes though… but in either case, it’s probably worth looking at the performance of your server code a little more before relying on your solution.

Good luck!

yes, i will dig deep into it :slight_smile: