Build Agent Artifacts Cache Cleanup Follow
Answered
Hello,
I've just checked my TeamCity folder and noticed that it's size just keeps growing even though cleanup is performed. After some investigation I found that the build agent's artifacts cache is the main culprit:
C:\TeamCity\Installation\buildAgent\system\.artifacts_cache
All my build artifacts are still there for all past builds which amounts to a lot of data and will quickly grow into a problem. My questions are:
- Is there a way to automatically get this cleaned up so that older build artifacts are removed (similar to build history cleanup)?
- Can I just manually delete not required folders in the cache?
Thanks for your help!
Mike
Please sign in to leave a comment.
Server cleanup applies to server's artifacts storage only.
Agent's artifacts cache properties can be customized: http://confluence.jetbrains.com/display/TCINT/Internal+%28debug%29+TeamCity+Properties+and+Abilities#Internal%28debug%29TeamCityPropertiesandAbilities-Agentartifactscacheproperties
Hi Sergey,
Thanks for you reply. Unfortunately when I click the link I get a page not found error? Any chance you could copy and paste the content?
Thanks,
Mike
Here you are:
Agent artifacts cache properties
teamcity.agent.filecache.flush.interval.ms - interval of periodic flushing cache state to disk (defaults to 7000 ms)
teamcity.agent.filecache.expiration.time.ms - cache entry expiration time. If an entry is oldre than that, it is re-fetched even if its metadata has not changed. Value "0" is equivalent to teamcity.agent.filecache.override=0, value less than "0" is equivalent to "forever" (Long.MAX_VALUE) (defaults to 48 hours)
teamcity.agent.filecache.size.limit.bytes - cache size limit. unlimited if 0 or less (0 by default)
teamcity.agent.filecache.override - always download cached entities (ignoring metadata state)
teamcity.agent.filecache.publishing.disabled - disable publishing to artifacts cache
Hi,
where should I add these properties?
Thanks,
Rodrigo
conf/buildAgent.properties
Hi,
I tried to set teamcity.agent.filecache.size.limit.bytes to limit cache size, tried to set teamcity.agent.filecache.publishing.disabled = true to disable caching altogether, restarted TeamCity service but nothing worked. Any further suggestions?
Fragment from properties file:
system.teamcity.agent.ensure.free.space = 10gb
teamcity.agent.filecache.publishing.disabled = true
system.teamcity.agent.filecache.publishing.disabled = true
Using TeamCity Professional 9.0.5 (build 32523)
Have the same issue. Did not manage to get it work with any agent settings. I have explained all details in stackoverflow. This is a reference for future visitors
https://stackoverflow.com/questions/69011174/teamcity-agent-artifacts-cache-issue-agent-accumulates-artifacts-from-all-prev