Author Topic: Headless-Server feedback  (Read 1156 times)

x211321

  • Guest
Headless-Server feedback
« on: 27 December 2011, 20:35:51 »
Hi there,

a friend (treba) and I are hosting a headless-server for Megaglest (engineer) and I was wondering how well you guys think it performs. I don't really play Megaglest myself (being more interested in the project than the game itself) so I never played any big games on our server. As far as I could see the server is frequented rather often so I thought some of you who played on it could tell me a little about its performance, especially during bigger games with many players/units.

The server itself is a rather small VPS which I initially rented to host some random projects on. So when the MG headless-server came out we gave it a try but it wasn't intended to run a MG server in the first place.

Server specs:
3 GHz QEMU single-core CPU (obviously a virtual CPU)
512 MB dedicated RAM (not shared with other VPS's on that machine)
100 Mbit Network connection
Running ArchLinux 32 bit (3.1.4-1 stock kernel)
Currently running MG v3.6.0.2 (we usually compile ourself from SVN)

When not running MG the server and running daemons have an average RAM usage of around 20-30 MB, though when a big MG game is is been played this might change rather quickly, filling up almost all available RAM. This is what concerns me the most since everything else seems to be fine. The CPU usage when hosting is usually about 20-30% with some short peeks of 60-70% now and then. And the network connection should always have enough free bandwidth.

Two days ago I noticed a rather big game which pretty much used the RAM to its limits so I was wondering if the server actually has enough power to run such games or if they become laggy.

Strangely the server list was showing 9 players connected though as far as I know MG only supports up to 8.
That game was played at the 25th december 2011 at about 11:20 pm (UTC+1).
http://engineer.megaglest.org/serverlist.jpg
http://engineer.megaglest.org/htop.jpg

So let me know how you experienced the server so far and if there are any problems we might be able to do something about it like renting a bigger VPS or limiting max players if thats possible.

treba

  • Guest
Re: Headless-Server feedback
« Reply #1 on: 28 December 2011, 22:40:19 »
i would like to add a question to the other hosters (of headless servers). as far as i know, engineer is the only server that is constantly up.
is that on purpose or do you still have the problem with the server disappearing from the serverlist?

we somehow solved that problem for us by writing a little script that checks every few minutes whether the server is still listed in the serverlist.
so if you are still having issues with that, you can try this one:
Code: [Select]
#!/bin/bash
status=`curl http://master.megaglest.org 2>/dev/null | grep 78.46.177.26`

if [ -z $status ]
        then
                killall megaglest >/dev/null
                $HOME/megaglest/start_megaglest_gameserver.sh >/dev/null
fi
just replace the ip with the one of your server and create a crontab that runs this script every few minutes.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Headless-Server feedback
« Reply #2 on: 28 December 2011, 23:14:04 »
@treba: This "killall" is not very fun when you are currently playing a game .....
Is there no better way to see whats going on? Something like "if the server is not listed on the master server and there are no slots open ".
I don't know how to test these open slots ( something with telnet maybe? )

@x211321: 512MB might be not enough for big games :-( .  But to know for sure tomreyn should comment on this. Maybe he also has an idea how to restart megaglest after every match.

Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

treba

  • Guest
Re: Headless-Server feedback
« Reply #3 on: 29 December 2011, 00:09:21 »
right now, megaglest get's restarted after every game.
you're right that it would be nicer to have some possibility to check whether there's currently a game running. but we didn't come up with a idea for that so far.
maybe there should be a possability to ask a server for his current status (and info about players, ram/cpu usage) on another port. but that would need to be implented in the game.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Headless-Server feedback
« Reply #4 on: 29 December 2011, 20:21:31 »
Every 'live' published game send an update to the masterserver every 30 or 60 seconds. We could make something on the masterserver that could be checked to see that the game has sent an update within the last 2 minutes.

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Headless-Server feedback
« Reply #5 on: 29 December 2011, 20:43:53 »
I agree it would be nice to be able to query the servers directly. I think many other games work this way, too, and it could be one way to take some load off the master server - which currently has one TCP connection per game server - whether it's hosting an ongoing game or not -  every 6 seconds. If not a network query interface, a CLI would be nice to have in the future so that scripts running on the server could query the current status of the game.

About current hardware requirements on a gameserver, 256 MB can be enough for a 4 player game on a 128x128 map, but if the map and number of players grows larger then it's mandatory to have 512 or more. Swapping to disk doesn't really help much since it makes the game run choppy for all connected clients. My impression is that for a decent gameserver you still need 768 to 1024 MB. Most memory intensive stuff should be taking place on the clients, though, so there may still be options to reduce the servers' footprint.

About the other game servers which used to be there 24/7 but are not now: I used to run a gameserver 24/7 on a virtual private server ('salt'/'archer') but had to take it offline since the virtualization turned out to be not as reliable in containing the gameserver as it should have been. I later configured it to only consume 256 MB ever, and without swap, causing the gameserver to be out-of-memory killed by the kernel in case MegaGlest started using 256 MB RAM, but this clearly gave a bad experience to users, so this didn't work out well either. I plan to bring it back once I'm replacing the hardware, which should take place early next year.
« Last Edit: 29 December 2011, 20:57:06 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

 

anything