TFS 2017本地部署:单构建服务器能否安装多代理并行执行任务?
Absolutely, let's break down each of your questions based on TFS 2017 on-premise deployments:
1. Can multiple build agents be installed on a single build server?
Yes, absolutely. TFS 2017 fully supports running multiple build agents on the same physical or virtual server. Each agent just needs its own unique working directory during setup—when you register a new agent, specify a distinct folder (instead of reusing the default one) and give the agent a unique name to distinguish it from others on the same server. You can even group these agents into the same agent pool or separate pools based on your needs (e.g., one pool for .NET builds, another for frontend tasks).
2. Will multiple agents help reduce task queuing via parallel execution?
Definitely. As long as your build/release tasks don't have exclusive execution constraints, multiple agents in the same pool will pick up queued jobs simultaneously. This directly cuts down on wait times for pending builds and releases. Just keep an eye on your build server's hardware resources (CPU, memory, disk I/O)—too many agents might overload the server, so start with 2-3 agents and scale up based on resource usage.
3. Do build/release definitions need extra configuration to work with parallel agents?
Most of the time, no extra setup is required for basic parallel execution. TFS will automatically route queued jobs to any idle agent in the assigned pool by default. That said, there are a few optional tweaks if you need more control:
- Agent tags: If you want specific tasks to run on certain agents (e.g., agents with a specific tool version installed), add tags to your agents and then define "Agent requirements" in your build/release definition to match those tags.
- Release deployment limits: For release definitions, check the environment settings—look for "Maximum number of parallel deployments" and set it to a value higher than 1 if you want to deploy to multiple targets (or utilize multiple agents) in parallel.
- Task-level parallelism: Some build tasks (like running tests) support parallel execution within a single job, which lets you split a single job's work across multiple agents if needed.
内容的提问来源于stack exchange,提问作者Venky Venkataraman

