找回密码
 注-册

QQ登录

只需一步,快速开始

查看: 2062|回复: 4

[服务器] Setting Your Server Rates (rewritten)

[复制链接]
Leya 发表于 2008-5-28 16:45:29 | 显示全部楼层 |阅读模式
***Thanks to CG1 we now have a handy little web based app that calculates rates based on the following post. You can find it here.***

*formulae for calculating server size have changed somewhat - May 18/05*

*see four posts down for more information*

*new information: Linux servers can handle much higher update rates on the same bandwidth than Windows servers can, so if you are running a Linux server, start off by dividing by 200, not 300 as suggested here*

I answered this question in another thread, but I thought I'd give this its own thread, seeing as this is probably one of the most common, and important questions a server admin could ask. And that question is, "How do I set my server rates?"

The formulas I am about to give are extremely conservative, but they work. As long as there are no other problems, these rates will ensure that you get the most out of your available bandwidth. Some of the things I am going to say here are also probably somewhat controversial, but I am just sharing what I have learned in two years of running a server, and in the many many hours I have spent reading up on this topic.

This thread is not for newbies. I don't have anything against newbies, I just don't have the energy or the inclination to write a newbies guide to setting up a Half-Life server. I am going to assume that you already know most of the basics of setting up a server. I am also assuming that you are running a dedicated server.

This information will apply to 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.

The first question is operating system. I would recommend either Windows 2000 or Windows XP, Home or Professional. I would not recommend running a server on a Windows 9x/Me machine.

Note that these suggestions are for Windows servers, not Linux servers. The hardware requirements for Linux servers are probably quite a bit less than they are for Windows. However, it should be noted that Half-Life, from what I have read, will probably run slightly better on a Windows server, than it will on a Linux server. This is not because there is anything wrong with Linux, but because HLDS hasn't been optimized properly to run at its best under Linux.

I am assuming here that you are running some sort of adminning tools and perhaps stats plugins. I will take this into account in the calculations. What I am about to say here is also probably going to be somewhat controversial, but this isn't intended to start a war. This is simply based on my experience, and you can take it or leave it.

AMX has become very popular lately, and of all the adminning tools out there, it is probably the sexiest. However, if you want to get the most out of your hardware and connection, I would recommend that you not use AMX. Admin Mod + Statsme is, in my opinion, a better choice for CS and TFC, and just plain old Admin Mod is the best choice for NS and DOD. If you really want to run AMX, I would suggest that you use AMX Mod X instead.

The reason why I say this, is that, in my experience, Admin Mod + Statsme is less demanding on your hardware than AMX. AMX Mod X seems to be somewhat better written than AMX and seems to run more smoothly on small servers than AMX does.

However, take this information and do with it as you please, if AMX/AMXX works well for you, then by all means use it, and enjoy. The only thing you should be aware of is, the more plugins you add, and the more complex those plugins are, the greater are your chances that you will experience problems with lag.

Having said all that, here are my recommendations for minimum hardware requirements. These assume you are running Windows 2000/XP + with some kind of adminning tools and possibly stats. These are just general suggestions and you may find that you can operate perfectly well with less. Note also that certain mods are more or less demanding than others.

Server Size: 8
CPU: 800
RAM: 256MB

Server Size: 16
CPU: 1200
RAM: 384MB

Server Size: 24
CPU: 1600
RAM: 512MB

Server Size: 32
CPU: 2200
RAM: 768MB

Once you've gotten your basic hardware in place, then setting your rates becomes all about the bandwidth available to you. You need to find out what your upload and download bandwidth are, from your ISP. You then use the lower of those two numbers for all the following calculations.

Probably the biggest single mistake that server operators make is setting their various rates far too high. We, and I have thought the same way in the past, all tend to think that in order for Half-Life to run well, you need to allow your clients 100 updates per second, and give your cients 20000 as a rate for bandwidth. We seem to confuse update rate with FPS, or somehow think the two are connected, so if we have a very low updaterate, the game will be choppy. Because of the way Half-Life is designed this is not the case. I have run a perfectly smooth running server with an updaterate of 6, and I am fairly certain your update rate can be as low as 4 without causing problems.

Having said all that, and once your hardware is in place, the most important cvars for running a lag free server are the following.

sv_maxrate
sv_minrate
sv_maxupdaterate

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

The first thing we will address is sv_maxrate. This is what controls the maximum amount of bandwidth your clients can use. This is very important, but it is only as important, and maybe not quite as important, as your maxupdaterate. But it is the rate you want to calculate first, so we will do that here.

The first thing you want to do before you determine your rate, is determine how many slots you should run, what your server size should be. I will base this on two calculations, one conservative, and one less conservative, but, in my opinion, equally functional.

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. I have run a server successfully with a maxrate as low as 2048. But the lowest I will recommend here is 3072. So here are the size calculations based on sv_maxrates of 6144, 4096 and 3072. Remember you are using the lowest of either your upload or download bandwidth for these calculations. For the purposes of these calculations you should always round down to the nearest number.

Note also that your bandwidth requirements per client increase as your server size increases. I do not recommend a rate any lower than 8000 for a server size larger than or equal to 24, 6000 for a server size larger than or equal to 16, or 4000 for a server size larger than or equal to 12.

sv_maxrate 8000

bandwidth in Kbps / 64 = recommended number of slots

sv_maxrate 6000

bandwidth in Kbps / 48 = recommended number of slots

sv_maxrate 4000

bandwidth in Kbps / 32 = recommended number of slots

sv_maxrate 3000

bandwidth in Kbps / 24 = recommended number of slots

So if you have 1400 Kbps in bandwidth available, and you are aiming for a sv_maxrate of 8000 you divide 1400 by 64 to get a server size of 21. If your hardware can support it, on that connection you can run a server with 21 slots. This server should run absolutely flawlessly with an sv_maxrate of 8333 (see below for where I got this number). Anything higher than 8000 is nice, but not essential to running a lag free, competetive server.

Running backwards you can calculate your sv_maxrate this way.

sv_maxrate = bandwidth X 125 / server size

So if you want to run a 24 person server, and you have 1400 Kbps in bandwidth available, 1400 X 125 / 24 gives you an sv_maxrate of 7291 (note that this is a bit lower than the minimum rate that I would recommend for a server of this size).

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. DIAL UP CLIENTS DO NOT CAUSE LAG, BAD SERVER SETTINGS CAUSE LAG. HIGH PING KICKERS ARE UNFAIR AND A LOAD OF CROCK! There, I feel better now.

The last thing to calculate is sv_maxupdaterate. This is, perhaps, the single most important server side setting. And this setting should be much lower than you might imagine.

The calculation that I recommend for sv_maxupdaterate is as follows:

sv_maxupdaterate = sv_maxrate / 300

So for the above sv_maxrate of 7466 you would divide that by 300 to get an sv_maxupdaterate of 24. Basically, start off with this formula, and if you are still experiencing lag spikes or high pings, adjust it downwards, one at a time, until you get stable pings that are as low as you are going to get on your server.

*see my next post in this thread, four posts down, for more details on sv_maxupdaterate*

And these are I think, the most important considerations and cvars in running a lag free, smooth running server. I expect to stir up a bit of controversy here, and spark some argument, but honestly, this is based on <font color=orange>a lot</font> of experience, and <font color=orange>a lot</font> of reading. You are welcome to take my suggestions here, or leave them.

*see four posts down for more information*

转自: http://forums.steampowered.com/f ... &threadid=98416
回复

使用道具 举报

Converse 发表于 2008-5-28 22:00:30 | 显示全部楼层
你能翻译过来吗?
回复

使用道具 举报

 楼主| Leya 发表于 2008-5-29 18:04:06 | 显示全部楼层
他是介绍如何计算服务器的网络设置的,可以连接到这里计算
http://www.reece-eu.net/drekrates.php
***Thanks to CG1 we now have a handy little web based app that calculates rates based on the following post. You can find it here.***
回复

使用道具 举报

Converse 发表于 2008-5-30 15:51:39 | 显示全部楼层
晕。发这个做为收藏吗?
回复

使用道具 举报

 楼主| Leya 发表于 2008-5-31 04:12:59 | 显示全部楼层
  这样也被你发现,这个计算服务器设置非常精确的

sv_minrate 0
sv_maxrate 0
sv_minupdaterate 0
sv_maxupdaterate 0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注-册

本版积分规则

Archiver|手机版|小黑屋|DoDVip ( 桂ICP备14000730号 )

GMT+8, 2024-5-7 15:43 , Processed in 0.058243 second(s), 20 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表