How to override Agent CPU Benchmark?
I've noticed that the Agent CPU Benchmark is wrong for our HP blades - we have a mix of CPUs and the benchmark doesn't reflect their relative power.
e.g.
blade1 is a Xeon L5420 with 8 cores at 2.5 GHz
blade2 is a Xeon X5550 with 8 cores plus Hyperthreading at 2.67 GHz
in the CPU benchmarks
blade1 = 318
blade2 = 248
Which is wrong - blade2 should be higher than blade1, even if ignoring the Hyperthreading (which we do find makes a difference for our code/data builds, so we use it)
I noticed that the CPU benchmark is stored in teamcity.agent.cpuBenchmark.
Can we override that in the agent config file or via a plugin? Even just manually setting it would allow us to get a more accurate benchmark.
Many thanks,
Mark
Please sign in to leave a comment.
Mark,
Actually agent CPU benchmark number does not have large significance. It is only relevant when there are two idle agents that did not run the Build Configuration earlier.
If the Build Cofiguration was already built on an agent, estimated buil duration (based on earlier runs) is used to determine which agent to choose.
However, there is a way to set the benchmark manually, if you like:
- run agent with -Dteamcity.agent.cpuBenchmark.enabled=false JVM property.
- add "teamcity.agent.cpuBenchmark=XXX" into buildAgent.properties file, where XXX is the desired number
Hi Yegor, that's very interesting to know that aspect of the TeamCity work allocator algorithm.
Does it include the VCS checkout time in the algorithm? This can be up to an hour for us for a clean checkout so is quite significant.
I've found that quite small changes in CPU architecture can make big differences to our tests, e.g. our 'slightly faster' blades turned out to execute tests 50% faster so I will certainly make use of the manual CPU benchmark.
Mark,
Checkout time is not reagrded when computing build estimates, please vote for TW-3765 if you like the idea.
As benchmark is used only during initial builds distribution and serves only informational purposes othervise, we used quite a simple algorithm to calcualte it, so it certainly is not meant to be comprehensively reflecting the CPU power.
A quick follow up to this, is cpuBenchmark limited to 3 digits?
I'm having problems getting this to work, it just shows N/A for agent CPU benchmark in Teamicty 6.0.1
To follow up on this, it is still not working :-(
I either get CPU of n/a if I disable the cpu benchmark, or it runs the benchmark and ignores what I put in the agent config file. So I don't think this feature is actually working.
Mark,
Seems you need to use system.teamcity.agent.cpuBenchmark, not teamcity.agent.cpuBenchmark property to set the index.
But again, I do not see any real use case for setting it as it is ony used for choosing agents only for the first build of a build configuration.
The number is not limited to 3 digits.
Sorry to raise this again. I now have this working on Windows agents but on Mac agents I just get N/A as the CPU benchmark in the TeamCity Agent list. In the Agent Paramters view it is correctly showing the value for teamcity.agent.cpuBenchmark (set via system.teamcity.agent.cpuBenchmark as discussed earlier)
I have tried putting -Dteamcity.agent.cpuBenchmark.enabled=false in the wrapper.conf in /Applications/buildAgent/launcher/conf/wrapper.conf by adding another wrapper.app.parameter.X parameter and renumbering the existing parameters. Is there anything else I need to do on the mac to pass the JVM option? We are using the launchd wrapper at the moment, although I'm tempted to change to using a shell script to launch teamcity on the mac as this works well on the PC and it's really easy to see if the TeamCity agent is running.
I know that the CPU Benchmark is not that significant to TeamCity, but it is very useful for us when communicating which blades are fast/slow when our users are looking at TeamCity.
Many thanks,
Mark
Mark,
Since the property processing logic is not platform dependent, Id' try investigating how the agent is launched and doublecheck the names to see if they differ from the Windows agent.
So far no idea as to why this can be different on Mac.
Thanks, just wanted to check there was nothing obviously wrong.
I'll try to launch the teamcity agent in a different way.
This CPU rank override could have an interest when you have multiple cloud agents and you want prioritize the usage (perhaps more simple than Agent priority plugin, which could have performance problem).
Sample: A "main" internal Openstack cloud configuration, with a lowest CPU rank than AWS cloud configuration.
In this case AWS is privileged for VM instantiation.
To force Openstack as privileged for instantiation, define in
buildAgent.properties:
teamcity.agent.cpuBenchmark.enabled=false
system.teamcity.agent.cpuBenchmark=1000
(system prefix only for property which define value is important). Tested on TeamCity 2019.2.