Page 1 of 1

Mage.Server excessive network bandwidth (Issue 2812)

PostPosted: 16 Apr 2017, 14:25
by noxx
This is topic to discuss current state on Issue 2812:
"Xmage server uses excessive network bandwidth"

At the moment gathering statistics:
1. Played one EDH game (around 35-40 turns)
It results in 2,5 Mb in and 35 Mb out for server
2. Looking for information on daily load
TBD

Actually the reason is clear: we are sending gameview too often even when not required.
What can be done? Long ago I remember having idea to implement sending game diff instead.
But it's not so easy to implement and bugs are possible as in case of lost packets next gamestate update on client won't restore it (as it does now).

It also may increase Memory usage (as you need to store previous state to get diff from) and CPU usage Server (you need to create diff for every server message).

Probably issue is somewhere in different place, then we need to add wrapper to start tracking it.

Re: Mage.Server excessive network bandwidth (Issue 2812)

PostPosted: 16 Apr 2017, 19:13
by noxx
Could make a progress by writing a test that emulating 60 players playing concurrent 30 games on local server.
Test is synthetic but still close to like: test players don't play anything and just skip phases (they have to discard 8th card starting from 2nd turn). Yes, this results in empty battlefield but even now it reproduces bandwidth issue.

Player count: 60
Games Played: 30 (standard)
Decks: randomly generated, 60 cards
Server: -Xmx2G -testMode=true
Client: -Xmx800M

Results:
Time duration for all games: 8 minutes
Mb in (Server received): 6.5 Mb
Mb out (Server sent): 784 Mb

One more finding with the test: time to time I see gameclient gets frozen (I have handler for it in test so it continues the play). But it means that message sent from Server gets lost.