This guide is going to cover a number of sections which relate to running the best server that your resources allow. In the field of gaming there is always an upgrade you can do to improve the way your system runs. There are also a number of security issues you should know about as well as understand logs. You are the system administrator and it is your primary responsibility to deliver a solution which works well.
Contents |
Abbreviations
- HLDS (Half Life Dedicated Server)
- RCON (The Basic Command Variables)
- CVAR (Game settings)
- CFG (Config File)
- CMD (The DOS command prompt)
- LAN (Local Area Network)
- WAN (Wide Area Network -> the internet)
- WLAN (Wireless Local Area Network)
- CD (Change Directory)
- DIR (List directory in DOS)
- LS (List directory in linux)
Hardware Minimum Requirements
(Great for a LAN) Well kinda....
- Memory
192Mb (This is just for the game, keep in mind what the o/s needs, and any programs running in the background.)
- Processor
500Mhz Intel or AMD
- Hard Drive
200Mb (Really there isn't a requirement, obviously you have to have the space to install the application. However the speed of the hard drive could matter. Some of the older 5400 RPM Maxtor drives (Bigfoot®) were slow.)
- Internet Upstream
256Kb (Use dslreports.com or speedtest.net to test your net connection)
Lan connections work great. No connectivity lag unless you use old hubs which create network collision or your on a flaky wlan.
Hardware Recommendations
(12+ players)
- Memory
1Gb+ (If you are only running one server with 32 players the max memory it will use is 640Mb however if you have a lot of addons/plugins and/or run more than one sever on the same box you may want to consider more.)
08Player Server = 160MB RAM 10Player Server = 200MB RAM 12Player Server = 240MB RAM 16Player Server = 320MB RAM 18Player Server = 360MB RAM 24Player Server = 480MB RAM 28Player Server = 560MB RAM 32Player Server = 640MB RAM
- Processor
1.6Ghz+ (Not sure what the cap srcds will use however I have seen some boxes with 3.4Ghz run at 70% cpu usage)
- Hard Drive
7200RPM+ (5400RPM will work fine, 7200RPM is much better, and 10,000RPM isn't necessary for SRCDS)
- Internet Upstream
1.5MBps+ (This seems to be the #1 bottle neck with hosting a server. Since a lot of people are running servers at home on their broadband connection it can be hard to get that type of upload from your ISP unless you are paying for one of there premium packages that offers more.)
Managing system resources LINUX
Some of these programs and/or commands may require superuser access. Remember to use su or sudo as a non privilege user. If you do not have any kind of superuser access then you maybe limited to what you can check.****
First of all use a little program called SCREEN. "Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells." -www.gnu.org/software/screen/
Bottom line its nice to use when you need to check your resources, edit configs, work on your mysql database, or anything that needs testing while your server is running.
To start a new screen session simply type: screen start your srcds change any CVAR's if you want. Then hold Ctrl and press A D. You just detached from your session while you server is still up. To reattach type screen -r and to kill the session type exit while in a screen session.
Ok so you have just detached and you want to check on your system resources (Memory, CPU, load avg, uptime, process's)
Command:
top
This displays dynamic real-time view of the running tasks managed by kernel and system information.
Individual monitoring may also be used as followed:
- MEMORY
Command:
free
This command will show you your current total memory state. How much you have, how much you are using, and how much is being used from swap.
Command:
ps -aux
This command reports a snapshot on information of the current active processes. Advantage of ps command is that system admins will be able to see where the memory is used. ps will show the percentage of memory resource that is used by each process or task running in the system. With this command, top memory hogging processes can be identified.
- CPU
The top command is still the most common however a lot of users like to use a program called sysstat which is wonderful if you have more than one CPU or more than one core cpu.
Command:
mpstat
This sysstat command allows you to display activities for each available processor, processor 0 being the first one. Global average activities among all processors are also reported. The mpstat command can be used both on SMP and UP machines, but in the latter, only global average activities will be printed.
- Hard Drive
To see the hard drive usage simply use the following command.
Command:
df
This command reports how much free disk space is available for each mount you have.
Warning research the next command before using it.
There have been SOME cases of HDD crashes you may need to know about.
THIS COMMAND REQUIRES SUPERUSER ACCESS
Command:
hdparm -tT /dev/(HD you wanna test)
With that being said this command for the most part is safe on newer or non failing drives. Failing drives or drives that are older are being stress tested and for that reason could destroy your drive if you are having problems.
Managing system resources MS Windows
Command:
Ctrl, Alt, Delete and goto task manager. Or goto your task bar right click and goto task manager.
Task manager is the most common program to manage your running process's, check memory status, check network status, and start/stop programs.
Individual monitoring may also be used as followed:
(These are all dos based commands)
- Memory
Command:
mem
Displays the amount of installed and available memory, including extended, expanded, and upper memory. Try adding -c and that will give you a process break down of memory.
- CPU
Command:
NONE
DOS is not multitasking o/s. See windows task manager.
- Hard Drive
Command:
dir|find "bytes free"
Or use windows disk management to get the full break down of partitions. Right click My Computer then click manage then Disk Management.
As for HDD testing, Disk Bench is a well known program that will test your hard drives RPM's. Again as always use cation and do your research on bench marking software and remember installing a program usually requires you to be the administrator of the system.
System Security
This is one of the most important sections of this article.
To be 100% secure use the following commands. In linux simply type: halt In Windows click start and goto shutdown.
In other words, it is impossible to be 100% secure however there are ways to minimize the risks.
Limit the access of the box to only the people who require the access. This refers to physical and remote access. Also disable Guest, support, and help accounts. (Remove keyboard, mouse, and monitor and only use remote login. If you can.)
Limit the number of programs on the box to the minimum you need to run your server. Remember their maybe security vulnerabilities in the software you are running.
Dedicate the box for it's primary purpose. I.E. Game Server
Use your o/s update tool to keep your system up to date. I.E. Windows Update (Linux has so many different ones, not gonna list them here.)
For windows you may want to consider an antivirus (Such as Kaspersky) simply because of so many different vulnerabilities in the o/s. Remember the Melissa virus.
Firewall your system, simple firewall script in linux to drop all connections on all ports except one's for srcds and any other programs you require. For windows Sygate Personal Firewall.
Depending upon how large your server is, it maybe good to have an admin on durning peek times to monitor the game play. There are a number of clans which focus on malicious activity that could effect your server. Sometimes a ban upsets them and they become hostel.
Shows a list of all connected IP address's.
netstat -a
Kill the connected IP
lsof -iTCP@ipaddress:port
Ban the IP from connecting to your server in any way.
iptables -I INPUT -s ipaddress -j DROP /sbin/iptables -L -n /sbin/iptables -F
I have written a web based script which im still working on that allows game admins to logon to a secure website and ban ip addresses and for how long. This allows my admins to have access to ban ip's directly from the firewall. It only works with linux at this time. Also I have my firewall setup to always allow local connections. This way one of my admins can ban a local ip and pervent me from connecting. hehe
Use Nessus, Security scanner for Oracle and various flavors of Unix (ALSO WORKS WITH WINDOWS). Performs over 900 remote security checks, and suggests solutions for security problems.
Create cron jobs to check your system for latest updates, set the correct time, update dns, and check scrds running status (Great way to enable automatic restarts on system crashes.)
To report malicious attacks to your server you can contact the following personnel in this order. Contact the ISP (Get this info from a simple whois lookup, if they are hosting a web server from that same IP you may consider contacting the host (brings attention to the intent of there customer), call the admin phone number listed on the dns lookup, if all else fails you can contact the FBI.
--als (This is a work in progress)
--Banana 07:12, 13 July 2009 (UTC)

