Make Your Cs 1.6 Server Lag Free

This information will apply to both serious professional server operators and small server operators who want to run a professional quality server on their home broadband connection. Home broadband connections will never be as good as a dedicated T1+ line for running a server, but it is possible to run a very smooth running, fun server off your home broadband connection.

Computer Stats:
Server Size: 8
CPU: 800 Ghz
RAM: 256MB

Server Size: 16
CPU: 1200 Ghz
RAM: 384MB

Server Size: 24
CPU: 1600 Ghz
RAM: 512MB

Server Size: 32
CPU: 2200 Ghz
RAM: 768MB

Specs- I recommend at least a 1.5ghz processor or faster. I also recommend 512 MB of RAM or more. A Pentium 4 isn't much faster than a Celeron, but a Celeron is fine as long as you aren't expecting to run a 20 player server with no lag. If you are short on memory such as 256MB of RAM, it will run, but it may lag when more and more people start joining. I recommend Windows XP Pro. I know all of you are thinking, why not use a Server Edition or 2000? I like Windows XP Pro because once its tweaked, it can run very fast. In addition to that, it is very user-friendly unlike Linux or Server Edition for the n00bs out there. Here are the specs of my server:

2.66 Ghz Core 2 Quad
2 GB RAM
Windows XP Pro


It runs around 9 players without any noticable lag. The next thing that you want to count into detail is the FSB (Front Side Bus). You want a high FSB. Front-side bus is the speed at which the CPU communicates with RAM memory and the motherboard chipset. My server has a very slow FSB, at 400mhz. Most new Penitum 4 computers have a 800mhz FSB. The more you have, the better. I would say you want a minimum of 400mhz FSB. The new 64 bit AMD processors have the FSB built into the chip, so any 64 bit AMD processor has plenty of FSB. If you can afford a 64 bit processor, get it. Many servers run RAID. RAID is when you have 2 hard drives, and you put them togethor for a performance increase. This may not be a great performance increase on SRCDS though, you will not notice much of a difference.

Running a Lag Free Half Life 2 Server:

--------------------------------------------------------------------------------

Internet- In addition to having a somewhat fast computer, you also need a fast Internet connection. I only recommend cable/anything faster (I recommend DSL if it has a high upload rate- see chart below for more info). Don't use wireless due to the slower speeds and sudden disconnection if there is an interference anywhere in the house. Since you will be on a network, (unless you are using the server on the same machine as you play games - I don't recommend!) try to keep as many people off the Internet as possible. If less people are on the network then more bandwidth will be available. DSL can be faster in some ways than cable, but, from experience, I do not recommend it.

Upload Download Speed

Cable
200 kbps-30 mbps
128 kbps-3 mbps

DSL
144 kbps-8 mbps
128 kbps-8 mbps

As you can see, cable has a far faster download rate. The advantage to DSL is that it has a high upload rate. When running a server, you want a high upload rate. Compare your cable/dsl companies upload rate. The more the better. DSL can be better than Cable in many ways.

--------------------------------------------------------------------------------

sv_maxrate
sv_minrate
sv_maxupdaterate

You will find these in your server.cfg file. If they aren't there, you will have to add them.

--------------------------------------------------------------------------------

sv_minrate should always be set at 0. This will allow your dial up clients to set their rate as low as they need to so that they can play with as little lag as possible.

Generally the most bandwidth you will ever need to allow your clients to use is 6144. Anything above this is gravy. It is also entirely possible to run a server with a maxrate of 3072.

sv_maxrate 6144

bandwidth in Kbps / 48 = recommended number of slots

sv_maxrate 3072

bandwidth in Kbps / 24 = recommended number of slots

Running backwards you can calculate your sv_maxrate this way.

sv_maxrate = bandwidth X 128 / server size

So if you want to run a 24 person server, and you have 1400 Kbps in bandwidth available, 1400 X 128 / 24 gives you an sv_maxrate of 7466.

--------------------------------------------------------------------------------

The last thing to calculate is sv_maxupdaterate. This is, perhaps, the single most important server side setting in running a lag free server. And this setting should be much lower than you might imagine, if you want to run a lag free, smoothly operating server.

The calculation that I recommend for sv_maxupdaterate is as follows:

sv_maxupdaterate = sv_maxrate / 512

So for the above sv_maxrate of 7466 you would divide that by 512 to get an sv_maxupdaterate of 14. This may seem extremely low, but I guarantee you it will give you a low ping, smooth running, lag free server.

-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Tweaks- Its time to tweak Windows XP! The following tweaks will improve your Windows performance. Before you edit the Registry, please backup it up by opening "regedit" from the run menu. Then select "File" and then "Export". Make sure you choose the "all" button for the export range.


A) This tweak lets you utilize the total amount of bandwidth offered from your Internet connection: (XP Pro Only)
1) Click Start, Select "Run"
2) Type "Gpedit.msc"
3) Expand the "Local Computer Policy" branch
4) Expand the "Administrative Templates" branch
5) Expand the "Network" Branch
6) Highlight the "QoS Packet Scheduler" in the left window
7) In the right window, double click the "limit reservable bandwidth" setting
8) On the settings tab, check the "enabled" item
9) Where it says "Bandwidth limit %" change it to read 0
10) Click Apply and then OKRunning a Lag Free Half Life 2 Server:

--------------------------------------------------------------------------------

This tweak will speed up the interface and speed up windows.
1) Go to the Display Properties by right clicking on the desktop and clicking Properties
2) Choose the "Apperance" tab and click "Effects"
3) Uncheck everything except "Hide underlined letters for keyboard navigation....."
4) Click OKPrevious Page (page 1)C) This tweak will speed up your interface once agian, it lets you use the Classic Windows Theme. The XP theme has a lot of visual enhancements that makes the computer slow down.
1) Proceed to the "Apperance" tab like mentioned in letter B.
2) Find the category "Windows and Buttons", and from the drop down menu, choose "Windows Classic Style"
3) Click Apply and then OK

--------------------------------------------------------------------------------

D) This tweak will let you see your icons faster. It doesn't really have to do with a server, but it makes navigation easier on the computer.
1) Open "My Computer"
2) Click the "Tools" menu and select "Folder Options"
3) Uncheck the first box that says "Automatically search....."
4) Click Apply and then OKE) Checking for Signed Drivers can reduce crashes.
1) Go to "Run" in the Start menu
2) Type "Sigverif.exe" in the blank box
3) Click "Start"

--------------------------------------------------------------------------------

F) Turning off Nonessential Windows Services can greatly improve performance.
1) Go to the "Control Panel", then select "Administrative Tools"
2) Select the "Services" icon
3) To disable a service: right click it, and select "Stop"
4) Here is a list of nonessential services:
Application Management
Clipbook
Error Reporting
Distributed Link Tracking Client
Help and Support
Indexing
IPSEC
Messenger
Remote Registry Service
Telnet
Windows Time
WMI Performance Adapter

--------------------------------------------------------------------------------


G) Defragmenting your hard drive puts files into order; which makes the hard drive faster. Make sure to do this weekly.
1) Go to "My Computer"
2) Right click on the hard drive that your game server is installed on
3) Go to "Tools"
4) Click "Defragment Now..."
5) Click "Defragment"

--------------------------------------------------------------------------------

H) Setting the CPU priority for a game server makes the server #1 on its list of things to do. (It makes it faster)
1) Press "Ctrl-Alt-Dlt"
2) Select the "Processes" Tab
3) Find your server name. For a Counter-Strike: Source server, the Service is called "Srcds.exe"
4) Right click on the server name
5) Click "Set priority", then select "AboveNormal" (note: you must do this every time)

--------------------------------------------------------------------------------

J) This tweak lets you overall boost your performance. (Tweaking the Swap File) You need 256MB of RAM or more to do this.
1) Select "Run", then "Start", and then type in "msconfig.exe"
2) Select the "SYSTEM.INI" tab
3) Add "ConservativeSwapFileUsage=1" under the "386enh" section
4) Click "OK" and reboot windows for the changes to take effect

--------------------------------------------------------------------------------

K) This tweak will decrease boot time and make XP A LOT faster.
1) Go to "Start", then "Run", and then type in "Regedit"
2) Locate the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters
3) Double Click "EnablePrefetcher", set it to "Decimal" and put a 3 in the box
4) Click "OK" and reboot windows for the changes to take effect

--------------------------------------------------------------------------------

You may also want to do an error-check every once and a while also.If you do not want to do this everytime, you can get a batch file that automatically sets it to run at AboveNormal. You can download a copy of a batch file here. Note- you have to edit the batch file to where you server is located, maxplayers, etc.... You can edit it by right clicking on the file and clicking edit. Once edited, you can run this batch file from anywhere on your computer, it does not need to be in the dedicated server folder. The batch file will automatically start the dedicated server.I) This tweak lets you fine tune your memory for better performance. You need at least 256MB of RAM to do this.
1) Go to "Start", then "Run", and then type in "Regedit"
2) Locate the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
3) Double Click "DisablePagingExecutive", select "Decimal" and put a 1 in the blank. This allows windows to keep data in memory instead of paging sections of RAM to the hard drive, Click OK
4) Double Click "LargeSystemCache", select "Decimal", and put a 1 in the blank. This allows XP kernal to run memory (improves system performance a lot). Click OK
5) Create a New "Dword" by right clicking in the "Memory Management" Folder. Once the "Dword" is created, name it "IOPageLockLimit". Double click it and select "Hexadecimal", put a 4000 in the blank if you have 128MB of RAM, set it to 10000 if you have 256MB of RAM, or set it 40000 if you have 512MB of RAM or more. This tweak will speed up your diskcache. Click OK
6) Reboot for changes to take effect

--------------------------------------------------------------------------------

L) I recommend updating to Service Pack 2 because it disables some services that aren't required. You can get Service Pack 2 by doing an update. Since Service Pack 2 has a firewall, you need to set your server.exe file to be a firewall exception.
1) Go to the "Control Panel"
2) Select the "Windows Firewall" icon
3) Select the "Exceptions" tab
4) Click the "Add Program" button
5) Select "Browse" and navigate to your server.exe

--------------------------------------------------------------------------------

M) This tweak will disable even more Windows visual enhancements that cause a slow interface.
1) Go to the "Control Panel", select "System"
2) Navigate to the "Advanced" tab and Select "Settings" underneath "Performance"
3) Select the "Adjust for best performance" bullet
4) Click Apply and OKRunning a Lag Free Half Life 2 Server:

--------------------------------------------------------------------------------

O) This tweak will improve the FPS (frames-per-second) that the server puts out. Most servers put out around 99 FPS, the handy application will make that FPS go past 300 FPS. When the server has low FPS, the players on the server will lag and their ping will be extremely high. The more FPS the server has, the quicker it can render frames- which in the end will make it much faster. You can check your server's FPS with the rcon command of "status"
1) Download the following program here
2) Launch srcdsfpsboost.exe
3) Minimize screen
4) To exit this program, maximize the screen and press any key followed by enter

--------------------------------------------------------------------------------

Q) Set the heapsize- This tweak allows the srcds.exe to use a exact amount of memory. (great performance boost)
1) Click right on the icon that you use to start your dedicated server
2) Find the target box
3) Go to the end of the line, and add -heapsize
4) After -heapsize add the following numbers for the amount of RAM you have:
128MB of RAM- 16384
256MB of RAM- 65536
512MB of RAM- 262144
1GB of RAM- 524288
2GB of RAM- 1048576
So if you had 1GB of ram, it would look like: -heapsize 524288

--------------------------------------------------------------------------------

R) TCP Optimizer- This program optimizes your internet so it can be the fastest it can. This is a program that you run, it requires no installtion. I have tested this program, and it works great.
1) Download the program here.
2) In the network adapter selection area, select the network adapter you use to connect to the internet
3) At the top, select your internet (Cable, DSL, Dial-up)
4) At the bottom, click Optimal Settings
5) Click Apply Changes
6) Click OK when asked to rebootYou may also want to do an error-check every once and a while also.P) This tweak will reduce the CPU strain that SRDS.exe makes.
1) Click start, run, and type in regedit in the box
2) From the drop down menus, navigate to HKEY_LOCAL_MACHINE
3) Navigate to SYSTEM
4) Navigate to CurrentControlSet
5) Navigate to Control
6) Navigate to PriorityControl
7) Click right inside the white box and select New-> DWORD Value
8) Type IRQ8Priority in the box
9) Click right on the new DWORD IRQ8Priority
10) Click Modify
11) Type 1 into the Value data blank
12) Click OK and close out of the registry editor

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

S) Improve NTFS Performance- Speed up your hard drive.
1) Click start, run, and type in regedit in the box
2) From the drop down menus, navigate to HKEY_LOCAL_MACHINE
3) Navigate to SYSTEM
4) Navigate to CurrentControlSet
5) Navigate to Control
6) Naviagte to Filesystem
7) Click right inside the white box and select New-> DWORD Value
8) Type NtfsDisableLastAccessUpdate in the box
9) Click right on the new DWORD IRQ8Priority
10) Click Modify
11) Type 1 into the Value data blank
12) Click OK and close out of the registry editor

--------------------------------------------------------------------------------

T) Unload .dll's to Free Memory- Free up memory left by programs that were closed.
1) Click start, run, and type in regedit in the box
2) From the drop down menus, navigate to HKEY_LOCAL_MACHINE
3) Navigate to SOFTWARE
4) Navigate to Microsoft
5) Navigate to Windows
6) Naviagte to Current Version
7) Naviagte to Explorer
8) Click right inside the white box and select New-> DWORD Value
9) Type AlwaysUnloadDLL in the box
9) Click right on the new DWORD AlwaysUnloadDLL
10) Click Modify
11) Type 1 into the Value data blank
12) Click OK and close out of the registry editor


Programs and other tips-

A) Always update Windows. You can update Windows by visiting the following website:
http://windowsupdate.microsoft.com/Running a Lag Free Half Life 2 Server:
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Spyware and Viruses WILL slow down your server. I prefer using Norton Anti-Virus to Remove Viruses, and Microsoft's Spyware Application to remove Spyware.
AntiVir Virus Scanner (freeware virus scanner): Click here to download
Spybot- Search & Destroy: http://www.safer-networking.org/en/index.html
Make sure you update all programs so you can ensure you are getting the latest files to scan your computer. Always scan your computer for Viruses and Spyware weekly. I also like to clean the registry of entries that are not in use, for that, I use Powerhouse RegSupreme.
--------------------------------------------------------------------------------
C) Make sure your drivers are up to date. Please visit your computer's manufacturer website for more information on obtaining new updated drivers.

www.compaq.com
www.hp.com
www.gateway.com
www.dell.com
www.ibm.com

You also want to update your computer's chipset drivers also. I'm not going to go over this because it is different for every computer. If you wish to find out more about updating your computer's chipset drivers, visit your computer's manufacture website.
--------------------------------------------------------------------------------
D) Always minimize the server screen because it uses less RAM when minimized.
--------------------------------------------------------------------------------
E) Running Clean Disk gets rid of files such as temporary Internet files that can slow down the computer.
1) Go to "Start", "Program Files", and then "Accessories"
2) Select "System Tools", then Select "Disk Cleanup"
3) Click "OK"
--------------------------------------------------------------------------------


Cvars:
Having said all that, and once your hardware is in place, the most important lag free tips are your cvars.
You will find the following cvars in your server.cfg file. If they aren't there, you will want to add them.

sv_minrate should be set to 5000 (setting it to 5000 will make dialup users not be able to play)
Set minrate to 0 if you want dial-up users to be able to play on your server
sv_maxrate should be set to 9999
sv_minupdaterate should be set to 13
sv_maxupdaterate should be set to 30

If you have alot of bandwidth, set sv_maxrate to 0. When it is set to 0, it allows unlimited bandwidth.

According to the Valve support page, the maxplayers should be set around the following:

128K uplink = 2 players
256k uplink = 4 players
320k uplink = 6 players
512k uplink = 9 players
768k uplink = 14 players
1024k uplink = 19 players
1140k uplink = 21 players
1708k uplink = 32 players

In order to find out your upload, Goto http://speedtest.net and run the test.

Enter your email address:
Delivered by FeedBurner

No comments: