Jump to content



Photo

Tips for game-server hosting

tipsg game server

  • Please log in to reply
5 replies to this topic

#1 JasperNL

JasperNL

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 05 August 2014 - 05:16 PM

In this section there are a lot of tutorials that may help you to set up game servers, but as soon as they're hosted, there may come some problems.

For instance, It's recommended to use 1GB of RAM for a Minecraft server, while the VPS only offers 128 MB RAM (and additionally 256 MB SWAP, which isn't as fast as RAM).

Another example: A Multi Theft Auto server uses about 100 MB of RAM as soon as it's loaded (depending on the resources), and when there are players this number is growing exponentially.

 

As may come clear in the examples above: RAM is the bottleneck in game-server hosting. A good idea may be to spare RAM.

 

Tip 1: The choice of the operating system

Since the server is running at 128 MB RAM, I highly disrecommend using a 64-bit operating system. Always choose an operating system ending with -x86 (which means 32 bit). Do not choose x86_64.

The reason why 64 bit operating systems are on the market is the demand of more than 4GB of RAM. 64-bit Operating Systems use considerably more RAM.

 

The choice of the distribution is quite important too. It appears that CentOS is using more RAM when all it's services are turned off than alternatives like Debian and Ubuntu.

I looked up the differences, and CentOS 6 uses 22 MB of RAM, while Debian 7 use 7 MB of RAM when no service is turned on.

Note that this is subjective. I'm a Debian/Ubuntu fanboy anyway.

 

I will recommend using Debian 7, the x86 version. If you want to use another distribution, think about the 32-bit point I made above: Always use x86!

 

Tip 2: Turn off services

I just re-installed my VPS and looked up the RAM usage. As you can see, there is 120 MB of RAM in use, and 15 MB of SWAP. In total, we've got 7MB of RAM left and 240 MB of SWAP.

It's smart to use as much RAM as you could. SWAP is slow and performing bad, so it'll slow down your processes (game-server) quite a lot.

 

Below you see the logs:

root@srv:~# free -m
             total       used       free     shared    buffers     cached
Mem:           128        120          7          0          0        113
-/+ buffers/cache:          7        120
Swap:          256         15        240

It's smart to look at the services that are running. You can look at these by entering "service --status-all". Below you find my logs:

root@srv:~# service --status-all
 [ + ]  apache2
 [ + ]  bind9
 [ - ]  bootlogs
 [ ? ]  bootmisc.sh
 [ ? ]  checkfs.sh
 [ ? ]  checkroot-bootclean.sh
 [ - ]  checkroot.sh
 [ + ]  cron
 [ - ]  fetchmail
 [ - ]  hostname.sh
 [ ? ]  hwclock.sh
 [ - ]  kbd
 [ - ]  keymap.sh
 [ ? ]  killprocs
 [ ? ]  kmod
 [ ? ]  modules_dep.sh
 [ - ]  motd
 [ ? ]  mountall-bootclean.sh
 [ ? ]  mountall.sh
 [ ? ]  mountdevsubfs.sh
 [ ? ]  mountkernfs.sh
 [ ? ]  mountnfs-bootclean.sh
 [ ? ]  mountnfs.sh
 [ ? ]  mtab.sh
 [ ? ]  networking
 [ ? ]  plymouth
 [ ? ]  plymouth-log
 [ - ]  procps
 [ - ]  quota
 [ - ]  quotarpc
 [ ? ]  rc.local
 [ - ]  rmnologin
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  samba
 [ + ]  saslauthd
 [ ? ]  screen-cleanup
 [ + ]  sendmail
 [ ? ]  sendsigs
 [ + ]  ssh
 [ - ]  sudo
 [ - ]  udev
 [ ? ]  udev-mtab
 [ ? ]  umountfs
 [ ? ]  umountnfs.sh
 [ ? ]  umountroot
 [ - ]  urandom
 [ ? ]  vzreboot
 [ - ]  wide-dhcpv6-client
 [ ? ]  xinetd

Pre-installed at the VPS'es are BIND, Apache2, Sendmail, OpenSSH and lots of other services. It's important to know what they do, because shutting down important services may cause problems.

 

Services that require a lot of RAM and can be stopped are: apache2, samba, bind9, sendmail

Especially Apache2 is a RAM eater, that's the standard installed HTTP server.

Bind is the DNS manager. You don't need this for a gameserver without HTTP.

Sendmail is for sending mails. You can compare it with Mercury for Windows. It also issues warnings inside the system, used by other services. It's not very demanding, but you'll probably not need it for a gameserver.

No idea what Samba is used for. It looks a bit like the package 'screen'.

 

Most services can be turned off with the command service [name] stop.

 

Logs:

[ ok ] Stopping Samba daemons: nmbd smbd.
root@srv:~# service apache2 stop
[ ok ] Stopping web server: apache2 ... waiting .
root@srv:~# service bind9 stop
[....] Stopping domain name service...: bind9waiting for pid 7615 to die
. ok
root@srv:~# service sendmail stop
[ ok ] Stopping Mail Transport Agent (MTA): sendmail.

Tip 3: Limit slots

Your server cannot run for 2 million people. Limit the slots to something like 12 to forsee complaining players. This depends on the amount of players, because (for instance) minecraft servers are extremely RAM-demanding, while a SA:MP server is not.



#2 milralze

milralze

    Member

  • Members
  • PipPip
  • 27 posts
  • LocationBrazil - São Paulo

Posted 05 August 2014 - 05:28 PM

Good tips, I have Counter-Strike 1.6 servers, and had no problem lagger, however when many people begin to enter, the memory reaches almost 100% usage in relation to cpu usage is low not pass 2.00%. And I still have a smacking panel to turn off the server


VPS BY HAPHOST

Servers Counter-Strike 1.6

www.mestreservidores.com.br


#3 JasperNL

JasperNL

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 05 August 2014 - 06:04 PM

Good tips, I have Counter-Strike 1.6 servers, and had no problem lagger, however when many people begin to enter, the memory reaches almost 100% usage in relation to cpu usage is low not pass 2.00%. And I still have a smacking panel to turn off the server

The CS1.6 server isn't very demanding like a minecraft server or a valve gameserver (gmod, team fortress). In my experience the CPU isn't a problem at all, as well. I'm happy to hear the tips may become useful :P

If the server is very slow it may be worth it to turn off the panel to leave RAM for the server, however that may be quite extreme :P



#4 Riste

Riste

    Member

  • Members
  • PipPip
  • 18 posts

Posted 09 August 2014 - 12:30 AM

Very usefully guide for newbies, with this even can run Minecraft server with 3 players or SA-MP server up to 100 players on 128 MB of ram, and of course depends on scripts. :)



#5 ghnn

ghnn

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 09 August 2014 - 09:26 AM

In this section there are a lot of tutorials that may help you to set up game servers, but as soon as they're hosted, there may come some problems.

For instance, It's recommended to use 1GB of RAM for a Minecraft server, while the VPS only offers 128 MB RAM (and additionally 256 MB SWAP, which isn't as fast as RAM).

Another example: A Multi Theft Auto server uses about 100 MB of RAM as soon as it's loaded (depending on the resources), and when there are players this number is growing exponentially.

 

As may come clear in the examples above: RAM is the bottleneck in game-server hosting. A good idea may be to spare RAM.

 

Tip 1: The choice of the operating system

Since the server is running at 128 MB RAM, I highly disrecommend using a 64-bit operating system. Always choose an operating system ending with -x86 (which means 32 bit). Do not choose x86_64.

The reason why 64 bit operating systems are on the market is the demand of more than 4GB of RAM. 64-bit Operating Systems use considerably more RAM.

 

The choice of the distribution is quite important too. It appears that CentOS is using more RAM when all it's services are turned off than alternatives like Debian and Ubuntu.

I looked up the differences, and CentOS 6 uses 22 MB of RAM, while Debian 7 use 7 MB of RAM when no service is turned on.

Note that this is subjective. I'm a Debian/Ubuntu fanboy anyway.

 

I will recommend using Debian 7, the x86 version. If you want to use another distribution, think about the 32-bit point I made above: Always use x86!

 

Tip 2: Turn off services

I just re-installed my VPS and looked up the RAM usage. As you can see, there is 120 MB of RAM in use, and 15 MB of SWAP. In total, we've got 7MB of RAM left and 240 MB of SWAP.

It's smart to use as much RAM as you could. SWAP is slow and performing bad, so it'll slow down your processes (game-server) quite a lot.

 

Below you see the logs:

root@srv:~# free -m
             total       used       free     shared    buffers     cached
Mem:           128        120          7          0          0        113
-/+ buffers/cache:          7        120
Swap:          256         15        240

It's smart to look at the services that are running. You can look at these by entering "service --status-all". Below you find my logs:

root@srv:~# service --status-all
 [ + ]  apache2
 [ + ]  bind9
 [ - ]  bootlogs
 [ ? ]  bootmisc.sh
 [ ? ]  checkfs.sh
 [ ? ]  checkroot-bootclean.sh
 [ - ]  checkroot.sh
 [ + ]  cron
 [ - ]  fetchmail
 [ - ]  hostname.sh
 [ ? ]  hwclock.sh
 [ - ]  kbd
 [ - ]  keymap.sh
 [ ? ]  killprocs
 [ ? ]  kmod
 [ ? ]  modules_dep.sh
 [ - ]  motd
 [ ? ]  mountall-bootclean.sh
 [ ? ]  mountall.sh
 [ ? ]  mountdevsubfs.sh
 [ ? ]  mountkernfs.sh
 [ ? ]  mountnfs-bootclean.sh
 [ ? ]  mountnfs.sh
 [ ? ]  mtab.sh
 [ ? ]  networking
 [ ? ]  plymouth
 [ ? ]  plymouth-log
 [ - ]  procps
 [ - ]  quota
 [ - ]  quotarpc
 [ ? ]  rc.local
 [ - ]  rmnologin
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  samba
 [ + ]  saslauthd
 [ ? ]  screen-cleanup
 [ + ]  sendmail
 [ ? ]  sendsigs
 [ + ]  ssh
 [ - ]  sudo
 [ - ]  udev
 [ ? ]  udev-mtab
 [ ? ]  umountfs
 [ ? ]  umountnfs.sh
 [ ? ]  umountroot
 [ - ]  urandom
 [ ? ]  vzreboot
 [ - ]  wide-dhcpv6-client
 [ ? ]  xinetd

Pre-installed at the VPS'es are BIND, Apache2, Sendmail, OpenSSH and lots of other services. It's important to know what they do, because shutting down important services may cause problems.

 

Services that require a lot of RAM and can be stopped are: apache2, samba, bind9, sendmail

Especially Apache2 is a RAM eater, that's the standard installed HTTP server.

Bind is the DNS manager. You don't need this for a gameserver without HTTP.

Sendmail is for sending mails. You can compare it with Mercury for Windows. It also issues warnings inside the system, used by other services. It's not very demanding, but you'll probably not need it for a gameserver.

No idea what Samba is used for. It looks a bit like the package 'screen'.

 

Most services can be turned off with the command service [name] stop.

 

Logs:

[ ok ] Stopping Samba daemons: nmbd smbd.
root@srv:~# service apache2 stop
[ ok ] Stopping web server: apache2 ... waiting .
root@srv:~# service bind9 stop
[....] Stopping domain name service...: bind9waiting for pid 7615 to die
. ok
root@srv:~# service sendmail stop
[ ok ] Stopping Mail Transport Agent (MTA): sendmail.

Tip 3: Limit slots

Your server cannot run for 2 million people. Limit the slots to something like 12 to forsee complaining players. This depends on the amount of players, because (for instance) minecraft servers are extremely RAM-demanding, while a SA:MP server is not.

nope it isn't true you dont get free 7 mb memory cached + free memory = 120 mb so you have 120 mb free ram..

linux can take programs to sleeping take to cache...

sorry for bad language and sorry if i was wrong


  • vyjhala likes this

#6 JasperNL

JasperNL

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 18 August 2014 - 04:53 PM

No, there's really 7MB free, but most of the 'usable RAM' is the SWAP memory :P

For game servers cached processes aren't relevant to take in mind.

 

You're right, pardon me :P






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users