Logic behind build agent choice

I'm curious as to how the build agent is chosen for a given configuration.  Basically I have two separate build configurations (staging and production) in with servers in two different physical locations, and I have a build agent in each physical location.  Ideally I'd like to have the staging agent build the staging configuration and the prod agent build the prod configuration. I know I can manually trigger a build, and I know I can add a requirement to force each configuration to only build on a specific agent, but I'm wondering if there's a better way.  Can I set a "preferred agent" for a build configuration?  If not, how smart is the logic behind the "Fastest Agent"? Will it randomly try each agent and learn which is faster for a given configuration?

Thanks in advance.

1 comment

The logic behind "fastest" is simple. If there are two agents available, TeamCity will calculate build estimates for both agents and then will pick the agent with smaller estimate. If estimate is not available at least for one of the agents, TeamCity will take CPU index into account.


Please sign in to leave a comment.