Java.exe Windows base priority for build Agents
Hi Everyone,
A little about my environment. We run TeamCity 7.1.1 on Windows Server 2003 and have about 20 build agents, mostly Windows 7 x64 VMs. We run the build agents in the console.
I've been encouraged to optimize our build agents in order to deliver faster builds and to provide a better CI environment. I determined our disk system might be a bottleneck and started playing around with putting the build agent working directories on RAM disks and SSDs. I saw some improvements, 10 - 15% faster times, however I still wasn't getting the performance I thought I should.
Investigating what processes might be consuming I/O from the builds, I noticed that the java.exe process for the build agent was running with its Base Priority (CPU) set to "idle" and its I/O priority set to "very low". I saw this using a couple different process monitors such as ProcessHacker and Process Lasso. After increasing the Java process base and I/O priorities to "normal", build times descreased substantially. I've included an example of the build times for one of our configs:
Compile 00:04:07.6677416
As you can see, the build with CPU and I/O priorities set to Normal ran 5m:20s faster! This build agent was on an SSD so I/O priority seemed to have a larger impact.
Now my question is, why is the java process priority set to idle and I/O priority set to very low? Is this only when running the agent in the console? We have one Windows 2003 BA that runs the agent as a service and the java process runs under a normal priority.
Is there any way to change this in TeamCity? Maybe when launching the build agent? For now, I'm using ProcessLasso to force all java.exe processes to normal CPU and I/O priorities.
Dylan
Please sign in to leave a comment.
In our case, we traced the problem to Windows Task Scheduler which by default puts the priority of scheduled tasks to low priority (see https://bdbits.wordpress.com/2010/04/29/setting-a-scheduled-task-process-priority/).
We just set the priority of the Task to 4 and it set the priority of the agent to any other interactive process (Normal with Normal IO).