Author Topic: I have a server, but no headless? Minimum resource use mode please.  (Read 3182 times)

badbod

  • Swordman
  • *
  • Posts: 15
    • View Profile
My server is fairly dainty. I would like to run a MG server. My Linux server is 24/7 with a 512 upload ADSL.

it is my gateway and firewall, with VPN and routing etc for my home network and runabout laptops.

I don't want to load it down too much so really,,  really,,  no headless?

Any tips or tricks to make it as light as poss so I can up this MG server 24/7 with minimal impact on my poor little Ubuntu x86_64 server/firewall (atom dual core cpu, 1gb ram, ubuntu 11.04, intel GPU integrated) much appreciated.

My desktop sits behind that and the NAT on my router. Plus my desktop is multi-booted too often for any reliable game server. I could forward etc but no point. It *has* to be on my 'totally underpowered for anything graphical' server. It is *never* rebooted and always contactable.

Any help/tips/tricks appreciated.

Another server I have spare is a VPS, 40Mb up and down unlimited, I am not using it and I have over 10 months left on it (Host wouldn't let me run Java on it without paying extra; 240Mb usage; well below the RAM allocated, huh go figure?). Without headless, I really can't do anything with that awesome bandwidth at all. This server is USA. 512 Ram, 2G Ram peak. Are you sure you can't do headless?

IP address 173.0.51.246 . View it if you don't believe me.

Looking forward to contributing, though my server will be in Thailand (the one that has a monitor and GPU that is), so not sure just how helpful that will be for the rest of the world. If you can work it out for the VPS (guessing it has to be headless, but I am not the guru) I am all in, PM me for SSH details. Please check site and time of last edit on this post to make sure they match.

Regards
BaDboD
Thailand
« Last Edit: 9 November 2011, 16:16:22 by badbod »

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,238
    • View Profile
We have a headless server in progress and so far we have made very good progress. Its highly likely it will be released in the next release.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
The headless is in SVN right softcoder?, so he would be able to build it from SVN and at least run the experimental version right?
WiP Game developer.
I do danish translations.
"i break stuff"

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Yes he can do this. I already have a "virtual appliance" (OVF format) here which I could share. After booting, it runs a script which does the following:
  • Check whether an update for the existing MegaGlest subversion working copy is available (following head), if so, download it
  • If there is an update, build this latest development version of MegaGlest
  • Run this development version of MegaGlest in dedicated server mode for a single game
  • Repeat all of the above steps
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 · · ·

treba

  • Guest
hey

can you share it, so i can test it on my server?

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
I can, but more likely you actually want something others can play on, too (if you actually want the headless development server, please tell)?
The 3.6.0 beta is coming up, most likely within the next 48 hours, and includes the headless server mode.

Code: (./megaglest --help) [Select]
--headless-server-mode=x            Run as a headless server.
                                    Where x is an option command: exit which quits the application after a game has no more connected players.

Once it's there and I've had a chance to do a test setup I'll provide instructions to host your own headless server here.
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 · · ·

treba

  • Guest
no i meant the script to automatically build the svn version. but you're right, it might be more sensefull to wait for the stable.
by then, i might have tinkered out how to compile it on arch.

is there already a way of building the game without the video/audio part? i just installed mesa on my server  :-[

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
no i meant the script to automatically build the svn version. but you're right, it might be more sensefull to wait for the stable.

You can use the beta, it was just released.

by then, i might have tinkered out how to compile it on arch.

I doubt it will be too hard, but you don't actually have to build yourself since we provide builds which should work.

is there already a way of building the game without the video/audio part? i just installed mesa on my server  :-[

I'm afraid not. When building you may choose which build targets to include, but there is not currently a build target which strips the game to its headless functionality only (I don't even know whether this would be possible). But hey, this is a pretty new feature, and I'm very happy there is a headless server (in that it works without X and can be remotely controlled) at all.
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 · · ·

treba

  • Guest
actually, arch is way to progressive to work with the ubuntu builds. would have to downgrade some stuff. but what does this minsizeref build type do?

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
actually, arch is way to progressive to work with the ubuntu builds. would have to downgrade some stuff. but what does this minsizeref build type do?

By 'ubuntu builds', do you mean our installers? Can you provide some examples of what you would need to downgrade to make it work on your system?
Where did you spot "minisizeref"?
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 · · ·

treba

  • Guest
Re: I have a server, but no headless? Minimum resource use mode please.
« Reply #10 on: 6 November 2011, 10:24:53 »
sorry, i meant MinSizeRel, it's a build type from the mg-linux compiling guide
but there is no explanation for it.

with ubutu builds, i mean your precompiled bins. don't you use ubuntu (8.04) for it?
i already removed the tarball of your release, but i will download it again to tell you which dependencies are broken
« Last Edit: 18 June 2016, 13:47:16 by filux »

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: I have a server, but no headless? Minimum resource use mode please.
« Reply #11 on: 6 November 2011, 10:35:43 »
Softcoder would know, I can only guess that it stands for "minimized filesize release". I haven't built this one, yet, and frankly wasn't aware of it.

And yes, I think it's correct that (at least some of) the installers are built on a Ubuntu 8.04? They do work fine on my (and many others) Ubuntu 11.10, though. It would be good to know why the installer did not work for you on Arch.
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 · · ·

badbod

  • Swordman
  • *
  • Posts: 15
    • View Profile
Re: I have a server, but no headless? Minimum resource use mode please.
« Reply #12 on: 6 November 2011, 12:30:56 »
would normally use CentOS on the VPS, but it is not being used, so can installl ubuntu server. Let me know how to get the headless ver and I will install it.

BaDboD

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: I have a server, but no headless? Minimum resource use mode please.
« Reply #13 on: 6 November 2011, 12:41:10 »
Glad that you're back in the loop, badbod. :)
I posted a sticky topic on how to setup a server on Debian or Ubuntu: How to host a dedicated server
You should be able to use CentOS if you prefer, it's just that the how-to is based on Debian.

Let me know if I can help. I'd also like to add a hostname for you, based on your favourite MegaGlest unit. So far we have archer.megaglest.org and engineer.megaglest.org - thanks, treba!
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 · · ·

badbod

  • Swordman
  • *
  • Posts: 15
    • View Profile
Re: I have a server, but no headless? Minimum resource use mode please.
« Reply #14 on: 7 November 2011, 03:51:49 »
[edit]
This post defunct. Please use scripts from official headless server guide at https://forum.megaglest.org/index.php?topic=7728.0.
[/edit]

Hi,
  Ok all setup and seems to work, can't get the startup and crontab scripts though.

here's what I did.

followed instructions from wiki, using Ubuntu 10.04

created file mg-restart.sh in /home/megaglest

Code: [Select]
#!/bin/bash
#
MGPROG="megaglest"

while [ true ]; do
sleep 2

pgrep ${MGPROG}
# if not running
if [ $? -ne 0 ]
then
cd /home/megaglest/megaglest
su - megaglest -c "/home/megaglest/megaglest/start_megaglest --headless-server-mode=exit" >/dev/null 2>&1 &
fi

done
so up to 2 seconds after server quits before it is restarted again.

then added following lines to /etc/rc.local

Code: [Select]
cd /home/megaglest
/home/megaglest/mg-restart.sh >/dev/null 2>&1 &

also added & (ampersand) to the end of the second to last line in start_megaglest script else it holds open the su and start_megaglest processes.

Didn't bother with cron cos can't check more than once a minute.  (My bad, couldn't get scripts fast enough for my itchy fingers  :) )

Bit concerned about CPU usage of the megaglest process, which is constantly hovering between 36% and 80%, without users. Anything we can do about that?

megaglest.org website is not responding/offline at the moment. Does not respond to MG client request for server list either. (fixed)

Regards
BaDboD
« Last Edit: 9 November 2011, 16:31:15 by badbod »

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: I have a server, but no headless? Minimum resource use mode please.
« Reply #15 on: 7 November 2011, 10:21:35 »
Thanks for your feedback, I'll rework part of the script I wrote based on it soon.

I do not understand what you mean by:

Didn't bother with cron cos can't check more than once a minute.

I'm also not happy with the CPU load, there seems to be something wrong there - the idle process should not consume so many resources, nor should the game in general when just one user or one user and one bot are playing.

I assume we need to do some profiling.I started a separate thread on this.
« Last Edit: 7 November 2011, 10:34:23 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 · · ·

badbod

  • Swordman
  • *
  • Posts: 15
    • View Profile
Re: I have a server, but no headless? Minimum resource use mode please.
« Reply #16 on: 8 November 2011, 10:15:57 »
Hi,
   Aah, i see, the cron is for reboot, without seeing the scripts I thought that's how you were checking for megaglest server running and restarting. My bad.

yes the idle is with no connections, not even 1 user.

PM me your id_rsa.pub and I will add it to the authorized keys for this server so you can SSH.

I will be a bit slow responding for the next week or so. Due to the flooding I have moved to Northern Thailand and the internet connection here is EDGE and pretty poor.

Regards
BaDboD
« Last Edit: 8 November 2011, 10:29:06 by badbod »

 

anything