How to see if a fetch or pull hit the scm pack file cache?

Hello,

I am using SCM cache in Stash, and not ref cache.

When I look at my access log files, I see when a clone hit or miss the scm cache.

But this cache contain pack files, that are also used during fetch and pull operations, if an update is truly required. Are those commands also using the scm cache? (I hope yes)
And do we have a way to see if the scm cache its hit for a fetch command?

 

An other question, relative to the same topic, is when I check the hits for shallow clone, it is always a miss. Do we have an issue here with the monitoring?

 

Regards,

Pierre

1 answer

0 vote

Hi Pierre,

Stash's scm-cache does not cache fetches; it only caches ref advertisements (when enabled) and clones. It does not cache fetches because the likelihood of cache hits is much lower for fetches; the pack that gets created for a fetch depends on the list of refs available on the server and the list of refs already present on the client. The chance of getting identical fetches in a small time window is significantly lower than the chance of getting identical clones.

when I check the hits for shallow clone, it is always a miss. Do we have an issue here with the monitoring

If you're only seeing misses for shallow clones, that implies that you're not getting identical shallow clones in the caching time-to-live window (default is 4 hours). You can experiment by performing two identical shallow clones shortly after each other. You should see cache:hit in the access logs for the second shallow clone.

Regards,

Michael

 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,953 views 1 5
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