Bandwidth usage questions and/or discrepency

Hi,

I have a relatively small Nakama instance, which is just exchanging presented. At the moment, I have 12 sessions, 34 presences. No custom scripts - only some post-authentication which creates groups and assigns users into them.

According to the Dashboard, the input, measured in kb/s, is about 5, and for output, about 250. However, according to btop, I’m seeing upwards of 4 Mi/Bs on download and 1.80 Mi/Bs on upload. After a restart of the containers, I’m seeing that climb again. I’ve isolated it to Nakama, and the rates seem to increase, even though it’s at a steady state with users.

I’m getting overage charges from my DigitalOcean VPS, topping the 4TB monthly limit, and I’m having a very hard time trying to narrow down what’s happening

It’s only letting me attach a single image, so here’s the corresponding dashboard metrics:

In my C# app, I am subscribing to presence updates for other users in the group. No matches being created or other updates being sent (yet). I’m planning on starting to send updates in about users, but something seems very off about the amount of traffic.

Does this make sense?

  1. Versions: Nakama 3.35.1+c76c942, using on Ubuntu in Docker
  2. Server Framework Runtime language (If relevant) {Go, TS/JS, Lua}

:tv: Media:

Hi @nabeel,

I believe the Console dashboard doesn’t include input/output data related to ws activity, which may explain the difference here.

Best.

Hi @sesposito

Thanks for your reply. There is a huge discrepency, though - what else is going out the ws? That overhead shouldn’t be many multiples of actual traffic

The dashboard is showing 50 Kb/s vs 30Mb/s going out from the machine in total. And I’ve confirmed that the 30Mb/s is all Nakama - looking monthly, that’s 120 Gb/mo reported and 5TB/mo going unreported

I checked my code, I do have an unauthoritative match started - but right now, there are no updates/messages going out as part of those matches. How often are presence updates sent?

I’m removing the match join to see if there are any changes in that bandwidth usage. But I just can’t understand what all that bandwidth usage is

Also, looking at the benchmarks, I’m showing more usage than it does - and it’s doing updates

ws traffic can be inherently noisy, there’s heartbeats and other messages that are continuously exchanged, plus, depending on the number of followed presences and etc, there can be message fanout that exponentially increases the traffic.

Besides heartbeats, messages are sent any time a user presence is affected (status change, disconnect, etc), match messages are relayed, chat messages are sent and received and so on.

If the disparity is much larger than what you’d expect, I suggest you maybe try to sniff traffic with tcpdump (or something else) and see what’s the bulk of the bandwidth is being used by (not sure how easy this is in practice).

Alternatively you could setup a client to simulate multiple connected users with your current workload but keep a global tally of data in vs data out on the WebSocket to see if it matches up with what you observe being reported on DigitalOcean.