Benchmarking SRCDS between different machines

I have 2 sandbox servers with identical configurations and set of addons on entirely separate machines, one being a virtual machine and one a dedicated machine, both running Windows Server 2012.
I would like to try benchmarking the performance of both SRCDS instances. My goal is to have a fair set of tests utilizing Lua that can identify which machine has the better performance with SRCDS.

There was an older binary module from 2010 that gave some additional methods of recording the server’s FPS at any given moment, though I imagine it doesn’t work anymore due to the changes to C++ interface for GMod13.

Does anyone have previous experience with this? I basically need suggestions for tests and an accurate metric to use for the comparisons.
Any help would be greatly appreciated. Thanks

Measuring FPS of server isn’t that hard. You can write a script which will rcon connect to the server and let it type stats in a frequency of 10hz which should be enough. (There are libraries e.g for php which can connect to the rcon).

This is the easy part.
But what about how to reasonable compare performance?
I think this is quite hard, it also depends on what you want to compare. Do you want to compare by having the same amount of players, by entitys or solely by the gamemode script?
In theory you could create server commands which can spawn entities, this way the remote script can spawn it, and see how the performance is affected.

But if you just want to determine which of both is better for hosting a garrysmod server then I honestly think that you can just run a cpu benchmark with one core.

LastPenguin and I fixed it :science101:

I have now rewritten the gmsv_fps too.
Instead of the engines FPS Counter, it uses a own counter of the system and calculates FPS by measuring the time between Think().

You can also benchmark:
lua_run require(“performance”)
lua_run performance.startBenchmark()

and after some time, to stop benchmarking:
lua_run performance.stopBenchmark()

It will generate a .csv file for you in the srcds folder, you can open it with excel and generate a diagram like this: https://i.gyazo.com/ca8bad0e29d9a15613593346d0959f10.png (@ The spike I spawned a vehicle)
I hardcoded the interval to 200ms for measurement.

Other methods:
performance.getFPS()
performance.getDiff() – Get Diff in µs
performance.getDiffMS() – Get Diff in ms

You can download it here: https://github.com/Sapd/gm_performance/releases

What I think is interesting about the old thread of gmsv_fps is, that the author made an example with modifying phys_timescale. This is really smart, because if the server can’t keep up, you can just slow down prop or even player calculations (this will e.g. make props just fall slower), ideal for all gamemodes who don’t rely on heavy PvP. The game “Eve online” makes use of this technique, it’s called time dilation https://wiki.eveonline.com/en/wiki/Time_Dilation .
I will maybe implement time dilation directly in my module after I looked at it closely, because it could be that phys_timescale is just a velocity multiplier and not a variable which affects how often the physics loop is called.