High latency when playing a game
Posted: 13 Nov 2013, 15:35
I'm having a problem with the latency going through the going through the roof when playing an 1v1 game.
First my configuration:
I'm using two independent chrome browsers to connect to smartfox, which is run on an other computer inside my LAN. Normally, during non-gameplay, the latency is between 1-2ms (according to the inbuild PING-PONG measurements).
Client: i7-2600 with 12GB ram and win7 x64
Server: i3-3110 with 16GB ram and win7 x64
Both connected using gbit having a very low ping (when using the dos ping command). The CPU load is always low (0-10%) on both computers and there is plenty of free RAM.
As soon as i start the game and don't control anything, the latency usually stays between 2-3ms, (but sometimes it starts at 100ms+ immediately).
If i start controlling the game, the latency goes up significantly and often around 250 ms, but not always.
The gamestate is a string of 400 length which gets transmitted (using a roomvariable) at each keypress or after each time-tick (when the game changes), which is about every second. During active gameplay there are +/- 3 update's (3 keypresses) a second .
I have NOT spend that much time on it to trace the cause, but so far i consistently get very high ping times sooner or later when playing a game.
Is my usecase to much of a load for smartfox (which i can hardly imagine)? Is the measured time incorrect because javascript is not multithreaded and somehow this mangles the times? What can i best to to find the cause?
First my configuration:
I'm using two independent chrome browsers to connect to smartfox, which is run on an other computer inside my LAN. Normally, during non-gameplay, the latency is between 1-2ms (according to the inbuild PING-PONG measurements).
Client: i7-2600 with 12GB ram and win7 x64
Server: i3-3110 with 16GB ram and win7 x64
Both connected using gbit having a very low ping (when using the dos ping command). The CPU load is always low (0-10%) on both computers and there is plenty of free RAM.
As soon as i start the game and don't control anything, the latency usually stays between 2-3ms, (but sometimes it starts at 100ms+ immediately).
If i start controlling the game, the latency goes up significantly and often around 250 ms, but not always.
The gamestate is a string of 400 length which gets transmitted (using a roomvariable) at each keypress or after each time-tick (when the game changes), which is about every second. During active gameplay there are +/- 3 update's (3 keypresses) a second .
I have NOT spend that much time on it to trace the cause, but so far i consistently get very high ping times sooner or later when playing a game.
Is my usecase to much of a load for smartfox (which i can hardly imagine)? Is the measured time incorrect because javascript is not multithreaded and somehow this mangles the times? What can i best to to find the cause?