TFS Build Server Disk Space Issue, is it ok to delete folder under Build Directory

StackOverflow https://stackoverflow.com/questions/22114750

  •  18-10-2022
  •  | 
  •  

Question

We are running out of the disk space on TFS Build server. I noticed that Build directory has 1-N folders. Inside it is the full binary sources etc.

Could someone please confirm if it's safe to delete these folders?

Was it helpful?

Solution

The build folder is generated by getting sources and then running tools (compilers, unit tests, etc) to generate outputs.

In most cases it is safe to delete the build folder - however, there are situations such as when you are using incremental builds where the build may not work correctly afterwards ... in the case of incremental builds, you need to force a full build to repopulate allthe source code that is needed, for example. However, if you created the build then you should have no problem sorting out these kinds of issues.

Unit tests in particular have a habit of accumulating lots of historical data over time.

Also check your drop folder - this will build up over time as every build is retained by default. You may wish to archive these builds in another server, or delete builds after a certain time. You can also configure (in the build definition) how many builds are kept, so for CI build you may wish to set this to 5 rather than the default of unlimited.

Another important place to clean out with TFS is the temp folder. Go to the build user account (C:/users/build/appdata/local/temp) and clean it out periodically, as TFS tends to leave a lot of mess behind (and in older versions it would start failing the build after creating 65536 temp files. One hopes that has been fixed by now)

I'd start with temp and then look elsewhere for things to delete if you still have a space problem

OTHER TIPS

I've found that the majority of the space utilized on our build server were IIS logs (C:\inetpub\logs\LogFiles\W3SVC2). This was determined using WinDirStat.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top