How to check the load of the server?

The 2009 Mana project went dormant around 2014 and was revived in 2023; it currently develops a client implementation for TMW and potentially other games.


Post Reply
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

How to check the load of the server?

Post by Ablu »

Hi,

I thought a bit about how to control the load of the server later and finding a way to check if the server suffers from too less cpu cycles for example. So I got the idea to maybe store how long the server slept between the last ticks. So admins could check the averange "sleeping time" (if it is positive = good, around 0 is starting to turn into a problem and below 0 would be really bad then. Of course we can check the cpu usage of the process. But i think the sleep time could give a more detailed view.

I wonder if this could be helpful / interesting to know. It might also help to find updates which cause performance issues if you keep track of this load value regulary and compare it with the current load.

Regards,
Ablu
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: How to check the load of the server?

Post by o11c »

Or you could just cat /proc/loadavg like normal people ...
Former programmer for the TMWA server.
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: How to check the load of the server?

Post by Ablu »

o11c wrote:Or you could just cat /proc/loadavg like normal people ...
As i said before, of course values like cpu usage of the process (well or combined stuff like the load value of the system) can be used for this stuff too. But especially the load value is rather vague. It might give you a good idea about how well the whole server works. But the time between the ticks of manaserv gives you a real value where you know what it means. The load value will not help you a lot if you want to know if the server is on the limit.

Regards,
Ablu
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: How to check the load of the server?

Post by o11c »

But it's highly unlikely that any delayed tick will be significant in the presence of network latency, unless the loadavg is above 1.
Former programmer for the TMWA server.
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: How to check the load of the server?

Post by Ablu »

o11c wrote:But it's highly unlikely that any delayed tick will be significant in the presence of network latency, unless the loadavg is above 1.
Well you can at least see how far away you are from that then.
atheros
Manasource
Manasource
Posts: 9
Joined: 09 May 2013, 15:41

Re: How to check the load of the server?

Post by atheros »

Ablu, don't listen to him. Knowing how long the gameloop takes to execute is actually important, and as you noticed, knowing the interval between them is also very important, as it's the best indicator of how well or bad the server is doing.
atheros
Manasource
Manasource
Posts: 9
Joined: 09 May 2013, 15:41

Re: How to check the load of the server?

Post by atheros »

Also issuing warnings when the interval goes down too low and errors when it drops to zero can also be helpfull
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: How to check the load of the server?

Post by Ablu »

atheros wrote:Also issuing warnings when the interval goes down too low and errors when it drops to zero can also be helpfull
Well i do not think we need to implement this into manaserv directly. I think manaserv can just log the thing into a database and an external tool can check this data.
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: How to check the load of the server?

Post by Ablu »

Could you tell us how to use this to get the info we want?

Regards,
Ablu
Frost
TMW Adviser
TMW Adviser
Posts: 851
Joined: 09 Sep 2010, 06:20
Location: California, USA

Re: How to check the load of the server?

Post by Frost »

The back end of this donkey looks very different than the front.

What do you actually want to measure? Performance metrics on the server? User experience? Limiting resources?
You earn respect by how you live, not by what you demand.
-unknown
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: How to check the load of the server?

Post by Ablu »

Frost wrote:What do you actually want to measure? Performance metrics on the server? User experience? Limiting resources?
I want to measure how well the server performes. The most simple way which came into my mind was to keep track of the sleeping time. We could even check this in the scripts and for example start to use a simpler mob ai if the value drops too low.

Even if the server starts to get overloaded you would not see this reliable on the cpu usage for example. The server would simply skip ticks (well he warns about this in the logs... but checking those is rather painful i guess).

Regards,
Ablu
Sanity
Peon
Peon
Posts: 33
Joined: 21 Oct 2012, 19:08

Re: How to check the load of the server?

Post by Sanity »

Ablu wrote:
Could you tell us how to use this to get the info we want?

Regards,
Ablu
I am still not quite sure what specific piece of data you are looking for, but for starters might run this example and see if it produces anything useful? https://perf.wiki.kernel.org/index.php/ ... h_perf_top
Ablu
Manasource
Manasource
Posts: 288
Joined: 23 Jul 2011, 08:31
Location: Germany

Re: How to check the load of the server?

Post by Ablu »

Sanity wrote: I am still not quite sure what specific piece of data you are looking for.
Sorry. I do not know how to explain this better than in my first post.

I want to sum up the time the game server sleeps (lets say per minute). So if the server would not do anything at all we would have a maximum of 100ms sleeping time per tick. If the server is under heavy load (lets say it needs 150ms to calculate a frame) we would have -50 per frame (negative value -> bad).

Regards,
Ablu
Post Reply