# Rdtsc_frequency



## Easy Rhino (Jun 23, 2009)

note: i'm putting this quesito in this section of the forum because i believe more users with programming knowledge will understand what i am talking about.

i run a l4d server that runs the "unrest 8v8" mod. this eats up the l4d game engine as it was only designed for 8 players max. my server is a q9400@2.6Ghz and 4 gigs of ram with a 20Mbit/20Mbit connection. Bandwidth and server hardware are not issues yet there still is some lag when you get 16 people on and hundreds of zombies spawning. like i said, the game engine wasnt designed for this. anyway, with games like TF2 you can set a server tickrate which is basically the amount of updates sent per second to clients. however l4d has this setting essentially disabled and instead uses the RDTSC_FREQUENCY application to measure the CPU and apply the appropriate tickrate. well SRCDS isnt made for multi-core processors so it measures the frequency but has no way of using the 4 cores to its advantage. RDTSC_FREQUENCY can be disabled or manually set and i am curious if i disable it can i set the tickrate myself? i know this is a long question but im positive some programmer here has a clue or can point me in the right direction.


----------



## FordGT90Concept (Jun 23, 2009)

Depends how it is programmed.  You can try it and entering the command without the value which should echo the command back to verify the change worked.


----------



## Easy Rhino (Jun 23, 2009)

FordGT90Concept said:


> Depends how it is programmed.  You can try it and entering the command without the value which should echo the command back to verify the change worked.



i think it will just echo back the CPU rate but what I am really looking for is what tickrate it sets.


----------



## FordGT90Concept (Jun 23, 2009)

Maybe this will help:
http://www.overclock.net/pc-games/59118-counterstrike-source-ticrate-tweak.html


----------



## W1zzard (Jun 23, 2009)

> Running a benchmark to measure system clock frequency...
> Finished RDTSC test. To prevent the startup delay from this benchmark, set the environment variable RDTSC_FREQUENCY to 3200.000000 on this system. This value is dependent upon the CPU clock speed and architecture and should be determined separately for each server. The use of this mechanism for timing can be disabled by setting RDTSC_FREQUENCY to 'disabled'.



have you tried changing that environment variable ?


----------



## FordGT90Concept (Jun 23, 2009)

Most computers won't have that environmental variable. 


RDTSC is a processor instruction which gets the current timestamp counter.  Frequency would be how often to get the RDTSC.


----------



## Deleted member 3 (Jun 23, 2009)

Bandwidth isn't the only relevant factor either. Your connection (or modem/router) can still be shitting out when there are many connections at once. What kind of connection are we talking about?


----------



## W1zzard (Jun 23, 2009)

FordGT90Concept said:


> Most computers won't have that environmental variable.



no computers have it.

l4d server checks for it and if it is set then the benchmark test is skipped and the value from it is used. it is designed to be manually set by the server admin to skip the benchmark/use custom values

"frequency" in that context means how much the counter is increased per second => cpu frequency.


----------



## Easy Rhino (Jun 23, 2009)

W1zzard said:


> have you tried changing that environment variable ?



im going to set it later tonight.


----------



## Easy Rhino (Jun 23, 2009)

DanTheBanjoman said:


> Bandwidth isn't the only relevant factor either. Your connection (or modem/router) can still be shitting out when there are many connections at once. What kind of connection are we talking about?



it is a 20mbit/20mbit connection. plenty of bandwidth for everyone. the only lag really comes from client's distance to the server but if you live in north america you get a solid ping of below 150ms. if SRCDS is setting a low tickrate on my server because it isnt reading all 4 cores then perhaps i can use the -tickrate variable properly when executing the server if i disable the cpu freq timer thing.


----------



## Easy Rhino (Jun 23, 2009)

W1zzard said:


> no computers have it.
> 
> l4d server checks for it and if it is set then the benchmark test is skipped and the value from it is used. it is designed to be manually set by the server admin to skip the benchmark/use custom values
> 
> "frequency" in that context means how much the counter is increased per second => cpu frequency.



ive also found out some information on the importance of a proper kernel configuration of linux systems. i guess you cant get a high tickrate if the linux kernel was not compiled with specific settings.


----------



## Deleted member 3 (Jun 23, 2009)

Easy Rhino said:


> it is a 20mbit/20mbit connection. plenty of bandwidth for everyone.



Read my post again.


----------



## Easy Rhino (Jun 24, 2009)

DanTheBanjoman said:


> Read my post again.



oh sorry, it's a fiber line with a prosumer modem. but this is more about the limits of SRCDS and their timing application.


----------



## FordGT90Concept (Jun 24, 2009)

W1zzard said:


> no computers have it.
> 
> l4d server checks for it and if it is set then the benchmark test is skipped and the value from it is used. it is designed to be manually set by the server admin to skip the benchmark/use custom values
> 
> "frequency" in that context means how much the counter is increased per second => cpu frequency.


Ah, I see.


There should be a list of commands (you can try the ones for CS:S) which modify the networking of the game.  All I can really suggest is tweaking them until you find what is best.  You could also get in touch with someone else that hosts a dedicated L4D server and figure out what they find works best.  I wouldn't be surprised if there is already a write up on the Valve forums.  All I know is that there is never really a magic number that always works the best.


----------



## Easy Rhino (Jun 24, 2009)

FordGT90Concept said:


> Ah, I see.
> 
> 
> There should be a list of commands (you can try the ones for CS:S) which modify the networking of the game.  All I can really suggest is tweaking them until you find what is best.  You could also get in touch with someone else that hosts a dedicated L4D server and figure out what they find works best.  I wouldn't be surprised if there is already a write up on the Valve forums.  All I know is that there is never really a magic number that always works the best.



i have messed with all the badnwidth settings and have decent luck. however, nobody seems to know if disabling the timer will allow for a manually set tickrate for the game. default tickrate for the game is 30. if i can set it to 100 then it will greatly improve performance. but i think tickrate is set when the timer runs its benchmark.


----------



## FordGT90Concept (Jun 24, 2009)

Did you try the -tickrate commandline parameter?  Here's a list of the lot of them:
http://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_4


----------



## Easy Rhino (Jun 24, 2009)

FordGT90Concept said:


> Did you try the -tickrate commandline parameter?  Here's a list of the lot of them:
> http://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_4



i was using -tickrate 100 but read it doesnt really do anything for L4D. i didn't know it could be set higher so i will try -tickrate 200 and see what happens. regardless, i want to know if by disabling their CPU FREQ timer I can mess with real settings.


----------



## FordGT90Concept (Jun 24, 2009)

It never hurts to try.  You could always reenable it if it doesn't.  I mean, if you give it a value it doesn't accept, it will always restore the default value.  There's really no way to cause major damage in that regard.


----------

