Page 1 of 1

max_lag exact meaning for server?

PostPosted: Wed Dec 31, 2014 16:21
by lag01
Hello.
Today and several days ago on my server in /status output i saw "max_lag = 17.7148".
Reason i checked /status in the first place fas 3-10 seconds lag for placing/digging nodes and running commands.
Can and should i do something about this max_lag? Any other ways to debug server performance?

Re: max_lag exact meaning for server?

PostPosted: Wed Dec 31, 2014 19:48
by Krock
max_lag shows you the worst connection (lag time in seconds) from the server to a client.

Re: max_lag exact meaning for server?

PostPosted: Wed Dec 31, 2014 21:28
by lag01
Krock wrote:max_lag shows you the worst connection (lag time in seconds) from the server to a client.

Ok.
So one of clients have unreal laggy connection, i just hope it is not affecting another clients.
So to tell if that can affect overall server performance i need to read source *.cpp files...

Re: max_lag exact meaning for server?

PostPosted: Wed Jan 07, 2015 18:55
by proller
Krock wrote:max_lag shows you the worst connection (lag time in seconds) from the server to a client.

no.

Re: max_lag exact meaning for server?

PostPosted: Wed Jan 07, 2015 19:12
by maikerumine
Can a slower client have an affect on the server and other clients? Or is it only client side?

Re: max_lag exact meaning for server?

PostPosted: Thu Jan 08, 2015 06:00
by Zeno
max_lag is kind of diffucult to explain. If you're interested in your **own** lag, RTT is the value you want to be looking at (not max_lag).

What max_lag (very basically) is how long the server takes to process a single "server step" (i.e. update the environment, make new map blocks, reply to all clients... stuff like that). Let's call that server_step_time. Every time server_step_time is greater than twice the current max_lag then max_lag becomes that new server_step_time.

Once the CPU processing spike goes away the max_lag decreases by .02% every server_step (unless it goes up again) until it again reaches the "normal" server_step time. This can take a while (maybe 5-10 minutes). So even if max_lag is showing, say, 5.6s the current server lag may be (and probably is) a lot less.

Anyway, from a client perspective RTT is the value you should be looking at, and that's for your client only. The minimum value for RTT is at least server_step_time, so it *is* kind of associated with max_lag for a particular instant but because of the way max_lag is calculated and decreased slowly it's not very well correlated at all (unless max_lag is constant).

Err, it's kind of complicated isn't it :/ max_lag is not really useful from a client's perspective at all because there is nothing the client can do about it. It's really more useful for people running a server and tuning server-side values. Even then, because max_lag is a weighted average (in effect) using a fixed value for the weight it's uses are (currently) limited (IMO)