Thread: Determining the rate/speed settings for your server

Results 1 to 12 of 12
  1. #1
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [uk]
    Posts
    8,477

    Determining the rate/speed settings for your server

    Rates

    Drek over at HLDS forums has written a very comprehensive guide on how you should determine
    • sv_minrate - minimum amount of data to send for each player (in bytes/second)
    • sv_maxrate - maximum amount of data to send for each player (in bytes/second)
    • sv_minupdaterate - minimum number of event updates to send per second to each player
    • sv_maxupdaterate - maximum number of event updates to send per second to each player

    You can find his guide here: setting rates for small home servers (formerly running a lag free server).

    I've also come up with a calculator that processes his rules according to the connection speed you have and how many player slots you intend to host on it. You can find this here: Drek's HLDS / SRCDS rate calculator (mirror).

    If you're running a LAN server (sv_lan is 1) then the server has control over client rates too. Every player is forced to use the server rate defined in sv_lan_rate. This should always be at the maximum 25000, unless you're running a LAN server over Hamachi or something.


    Speed

    Next I'd like to tell you a bit about how quickly your server will run. You define this yourself with a cvar called sys_ticrate. Hold on there Timmy, don't go changing it just yet. It's important you understand what kind of impact the value of this will have not only on the speed your game server, but how also how it will consume resources on your system, and also the impact when your system inevitably becomes overloaded.

    sys_ticrate is pretty much identical to the fps_max setting you have on your client-side. It determines the minimum interval for the event queue to be processed within 1 second. Quite simply, the higher the tickrate, the faster your server will appear to run. This is because the delay between processing the event queue is much tighter.

    As this diagram shows, the queue is handled at each line along the bar.


    • With sys_ticrate set to 10, this divides 1 second into 10 timeslots creating a delay of at least 100ms between handling the event queue.
    • With sys_ticrate set to 100, this divides 1 second into 100 timeslots creating a delay of at least 10ms between handling the event queue.
    • With sys_ticrate set to 1000, this divides 1 second into 1000 timeslots creating a delay of at least 1ms between handling the event queue.

    You can set your tick rate from 16(ish) to 1000! It's normally at 100, but may have trouble passing 60. See the bottom of this post to find out why.

    As you increase sys_ticrate, you will see the effect of this simply by looking at your ping on the scoreboard. Even the command to calculate your ping is done through the same event queue. So at a tick rate of 100, the minimum ping you could possibly have is 10ms as that is the minimum time in which your ping calculation will be handled. Likewise at a tick rate of 1000, the minimum ping you could have is 1ms -- although you will rarely see this even on a server connected directly via Gigabit Ethernet.

    You can also see this server side by using the stats command, and looking at the FPS value. Spam the command 5 times or so within a second to get a rough idea of how well your server is actually performing at that moment in time.

    So in short, a higher tick rate means a faster server.


    Why you should not run your server as fast as possible

    Before you go setting all your servers to 1000, you need to consider these impacts.
    • Doubling the tick rate means double work for the server processor - even when nothing is going on
    • Higher tick rate means more data update each player with, straining your Internet connection further
    • The big one: Players will notice heavy lag when your server processor is maxed out
    • The bigger one: A tick rate too high will severely screw up physics calculations in the game engine

    Let me explain that 3rd point in detail. So, you have a server happily running at say a tick rate of 500. A few players join at the start of a map, not much happening, still running at 500. The problem: more players start to join, players reach busy parts of the map, the server processor gets busy. The server processor can no longer keep up to run at a tick rate of 500, so it has to slow down to a tick rate of 50.

    The problem is not the fact that the server has to slow down, it's the fact that players will notice the server slowing down.

    If you were only running your server at a tick rate of 100 in the first place, there would only be a 50 tick drop in performance. This is quite small. Players would only incur around a 10ms ping increase during the busy period of the map. However as players were comfortable with your 500 tick rate performance, a hit of 450 ticks is 9 times larger - 9 times more noticeable with around a 90ms ping increase. This is when your players will complain about how laggy your server is, and often play elsewhere instead.

    This is why it is ideal to set a tick rate that is both fast, but also sustainable most of the time. I rarely exceed a tick rate of 200, as a 5ms event queue delay is hardly noticeable, and players get a very small spike when the server processor gets maxed out at times. It is also up to you to benchmark your server performance during busy parts of maps with plenty of players connected - preferable full. Benchmarking your server while it is empty is like building a fresh new road without knowing how much traffic will be using it.



    Now to elaborate on the 4th point in detail.

    Not all of the game physics, handled by the GoldSrc game engine, are synchronous. Different calculations appear to run at different intervals. Some side effects noticed certainly when testing is that moving brush entities will appear to move more frequently than point entities, if the server tick rate is high enough. This can result in point entities being inside a brush entity, for example a player ending up inside a lift floor. This will usually result in a moving brush entity killing players and NPC's just by "looking at them funny".

    Evidence of this can be easily reproduced on the map "Turret Fortress". Start it up, change the tick rate to 1000, and start the waves. Nearly every NPC will be crush by the lift moving the NPC's up to the walk way, even though nothing is on top of them to cause any crush damage.

    This is why you should not really go over 200 frames/second.



    Why your server won't run faster than 60 FPS

    This mainly applies to Windows servers...

    The timeslots that HLDS can provide is dependant on the timer resolution of the operating system it runs on. Windows has a default timer resolution of 60 ticks/second. There are plenty of ways to change the timer resolution though.

    I've not tested or seen evidence of this, but I've heard that the default timer resolution is the same as your monitor refresh rate. Needs confirmation.

    The oldest trick is to load up Windows Media Player, open a video inside it, but don't play it. Leave the video stopped, and minimize the player. This will give you a maximum timer resolution of 1000, also allowing a tick rate of 1000. However Windows Media Player can take up a fair chunk of your server memory.

    Secondly there are various plug-ins for Metamod (known as "ping boosters") that can also adjust the timer resolution of the operating system. These however have been somewhat unstable compared to other solutions, and take up more memory than the simplest solution available.

    The simplest solution is to download a small tool called "srcdsfpsboost". I've put up a copy here: srcdsfpsboost.zip. This is a tiny EXE file that you simply run, then leave in the background. If you would like to run this as a service so you never have to know it's there, here's how:
    1. Extract "srcdsfpsboost.exe" to somewhere like "C:\"
    2. Open up the Command Prompt
    3. Run this command: sc create srcdsfpsboost binPath= "C:\srcdsfpsboost.exe" start= auto DisplayName= "SRCDS FPS Booster"

    You may also need to start the service after you create it with the command "sc start srcdsfpsboost".


    Why your server won't run faster than 500 FPS

    Again, this section only applies to Windows servers...

    This is a limitation in both Windows and your hardware. You can get up to 1000 FPS by running your server on an Intel processor on a motherboard with certain Intel chipsets. Otherwise, be happy with 500 FPS.

    Also as I explained earlier, it's not a good idea to exceed 200 FPS anyway.
    Attached Images Attached Images
    Last edited by AdamR; 11-02-2012 at 11:19 PM.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  2. #2
    Registered User monkeyknuckles's Avatar
    Join Date
    Jun 2004
    Posts
    54

    Re: Determining the rate/speed settings for your server

    Thanks for sharing this. I particularlly like your calculator.

    I've been trying to tweak server settings for the last 5 years and have yet to find the best settings.

    I'm going to try your caluculator on my sometimes server.

  3. #3
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [uk]
    Posts
    8,477

    Re: Determining the rate/speed settings for your server

    If you still get bad lag on your server after using the calculator, check out Drek's thread on Steam forums (link in the first post). He has some workarounds that may help you further.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  4. #4
    Registered User
    Join Date
    Apr 2003
    Location
    Missouri, US
    Posts
    6,344

    Re: Determining the rate/speed settings for your server

    If you attach Cheat Engine to explorer.exe, enable speedhack, and set the speed to 1:1, HLDS will attain a framerate of 1000. Explorer.exe's timer IS affected, but I do not know if this trick actually does something useful or if it just distorts and skews framerate readings (two different things!).

  5. #5
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,076

    Re: Determining the rate/speed settings for your server

    By the way, if sys_ticrate is 64, 128, 256 or 512, HLDS seems to have an easier time at keeping the FPS consistent.

  6. #6
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [uk]
    Posts
    8,477

    Re: Determining the rate/speed settings for your server

    Quote Originally Posted by Qwerty View Post
    If you attach Cheat Engine to explorer.exe, enable speedhack, and set the speed to 1:1, HLDS will attain a framerate of 1000. Explorer.exe's timer IS affected, but I do not know if this trick actually does something useful or if it just distorts and skews framerate readings (two different things!).
    Is this likely to spark players getting banned by VAC? I don't mean everyone, but some people run HLDS and play on the same server on the same machine. Could that get the person hosting the server VAC banned?

    Quote Originally Posted by Silencer View Post
    By the way, if sys_ticrate is 64, 128, 256 or 512, HLDS seems to have an easier time at keeping the FPS consistent.
    That would be quite odd, as the timeslots are divided within a 1 second time space (1000ms) rather than 1024ms. It would be interesting to see some benchmarks of this.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  7. #7
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,076

    Re: Determining the rate/speed settings for your server

    Quote Originally Posted by AdamR View Post
    Is this likely to spark players getting banned by VAC? I don't mean everyone, but some people run HLDS and play on the same server on the same machine. Could that get the person hosting the server VAC banned?
    A simple CPU speedhack cannot be detected the clean way. You'd have to monitor and check the velocity of the player at every point in game, and if it is at 1.0 there will be no difference.

    About those ticrates being more consistent: Have you just tried doing it yourself?

  8. #8
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [uk]
    Posts
    8,477

    Re: Determining the rate/speed settings for your server

    Quote Originally Posted by Silencer View Post
    A simple CPU speedhack cannot be detected the clean way. You'd have to monitor and check the velocity of the player at every point in game, and if it is at 1.0 there will be no difference.

    About those ticrates being more consistent: Have you just tried doing it yourself?
    I mean the fact that the player would have the binaries loaded in the first place. VAC would notice that if someone plays on their 1000fps server on the same computer.

    Yeah I did try those tick rates you suggested, didn't see too much difference but a tad more consistent than round numbers.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  9. #9
    Registered User
    Join Date
    Apr 2011
    Posts
    15

    Re: Determining the rate/speed settings for your server

    The srcdsfpsboost.exe as a Task. It doesn't work well @ windows server 2008 R2
    There are response problems.

    Also there has to be a SPACE between the "=" and the Value

    Example: binpath= "test"

  10. #10
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [uk]
    Posts
    8,477

    Re: Determining the rate/speed settings for your server

    I run it on Server 2008 R2 now, seems to work fine :s Mine is a service though.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  11. #11
    Registered User
    Join Date
    Apr 2011
    Posts
    15

    Re: Determining the rate/speed settings for your server

    Quote Originally Posted by AdamR View Post
    I run it on Server 2008 R2 now, seems to work fine :s Mine is a service though.
    Hmm i always get an "Response" error, so the plugin is not response in time. I started it manually then its working. Just the Task think doesn't work on mine.

  12. #12
    Green eyed cat @n!t@'s Avatar
    Join Date
    Jan 2009
    Location
    Anitalink.com
    Posts
    150

    Re: Determining the rate/speed settings for your server

    The problem of FPS 60 was just on old win hlds, on last builds it's fixed, max limit i saw was 1024 without players
    Anitalink.com
    Жизнь порой несправедлива... но любовь придаёт этой несправедливости смысл...
    Life is unfair from time to time... But love gives a sense to this injustice...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •