stash removing cache

my files system for stash is 100% full and I want to remove some of the large files that are cached as caches is taking up the space, what is the best manner to accomplish this?


2 answers

1 accepted

1 vote
Accepted answer

You're most likely running into space issues because of the caches under STASH_HOME/cache/scm. These are caches for git operations such as ref advertisement and clone. Especially clones can be fairly large depending on the size of your repositories.

The scm-cache has a 'minimum free space' setting for controlling when it will stop caching. Default is 1Gb but you can configure a higher value in your You'll need to restart Stash to apply the new configuration. 

What do I put in the file? Also is it possible that we do not have a minimum free space set to on as it filled the partition to 100%, all that is on that partition is stash's home. We almost never have more than a Gig of free space there...

This is the default that Stash uses if you haven't overridden it. # Controls when caching is disabled because there is not enough space available on the file system # Configured value is in BYTES. The default is 1GB When there is less than 1GB free Stash won't write to the cache. However, if you have 1.5GB free and then clone a repository that is 1GB you'll end up with 500MB free. Ideally, you'd configure this setting to be a bit higher than the size of your largest repository. If you're not using a CI server for builds or you only have a small number of builds, you can also disable the caching completely by adding this to you plugin.stash-scm-cache.upload-pack.enabled=false

The cleanest way of removing the cache is restarting the Stash service. In order to avoid the same problem in the future, set this in your Stash config to the desired value:

#min. disk space left by caching, 32GB

(The default value is very small.)

That looks fairly large, We do not have a lot of space on that disk. And if there was a default why would it fill up the partition to 100%? Currently we have the home in its own partition which is 6 gig. What should I set the minimum to?

As Michael said above, the default is 1GB, I think that should be good for you. If the disk got completely full, it was probably not the cache that filled the last 1GB. Check what else is big. For us the log files can accumulate to quite much data, especially when debug logging is on.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,961 views 7 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you