Slow Git Operations

Im running a stash (2.12) with 240 repositories, and 14 add-ons, and every operation that runs on git is taking, in avarage, 2 to 3 seconds to complete.

[3338ms] - /usr/bin/git cat-file -t refs/heads/master:src/br/com/sipag
[3363ms] - /usr/bin/git ls-tree refs/heads/master:src/br/com/sipag
[3291ms] - /usr/bin/git cat-file -t refs/heads/homologacao:src/br
[3388ms] - /usr/bin/git ls-tree refs/heads/homologacao:src/br
[3505ms] - /usr/bin/git cat-file -t refs/heads/master:src/br/com/sipag
[3097ms] - /usr/bin/git ls-tree refs/heads/master:src/br/com/sipag
[1947ms] - /usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 -1 refs/heads/homologacao --
[2475ms] - /usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 -1 refs/heads/master --
[2232ms] - /usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 --ignore-missing --stdin --
[2314ms] - /usr/bin/git for-each-ref --sort=-committerdate --format=%(refname)%02%(refname:short)%02%(objectname) refs/heads/
[3683ms] - /usr/bin/git for-each-ref --sort=refname --format=%(refname)%02%(refname:short)%02%(objectname) refs/heads/
[3547ms] - /usr/bin/git for-each-ref --sort=refname --format=%(refname)%02%(refname:short)%02%(objectname) refs/heads/
[2149ms] - /usr/bin/git for-each-ref --sort=refname --format=%(refname)%02%(refname:short)%02%(objectname) refs/heads/
[3313ms] - /usr/bin/git diff-tree --always --format=commit %H%n%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 --root --stdin --
[2209ms] - /usr/bin/git for-each-ref --sort=-objecttype --format=%(objecttype)%02%(refname)%02%(refname:short)%02%(objectname)%02%(*objectname) refs/heads/ refs/tags/
[2601ms] - /usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 --ignore-missing --stdin --
[2458ms] - /usr/bin/git for-each-ref --sort=-objecttype --format=%(objecttype)%02%(refname)%02%(refname:short)%02%(objectname)%02%(*objectname) refs/heads/ refs/tags/
[2187ms] - /usr/bin/git for-each-ref --sort=-objecttype --format=%(objecttype)%02%(refname)%02%(refname:short)%02%(objectname)%02%(*objectname) refs/heads/ refs/tags/
[2119ms] - /usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 --ignore-missing --stdin --
[2951ms] - /usr/bin/git rev-list --format=%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 --ignore-missing --stdin --
[2527ms] - /usr/bin/git diff-tree --always --format=commit %H%n%H%x02%h%x02%P%x02%p%x02%aN%x02%aE%x02%at%n%B%n%x03 --root --stdin --
[2198ms] - /usr/bin/git cat-file -t refs/heads/producao:
[2195ms] - /usr/bin/git ls-tree refs/heads/producao:
[2350ms] - /usr/bin/git cat-file -t refs/heads/producao:
[2709ms] - /usr/bin/git ls-tree refs/heads/producao: -r
[2211ms] - /usr/bin/git cat-file -t refs/heads/producao:
[2332ms] - /usr/bin/git ls-tree refs/heads/producao:
[2301ms] - /usr/bin/git cat-file -t refs/heads/producao:arquivosTeste
[2347ms] - /usr/bin/git ls-tree refs/heads/producao:arquivosTeste

The machine (XEN VM) have 12 core @2.4 Ghz CPU; 6GB of memory allocated to the stash process; 15k rpm disk; git version 1.7.10.4

this is making the site navegation to be very slow, what can i do to speed things up?

2 answers

1 accepted

Hi Bruno,

As Deric mentioned the git operations do require memory but are off-heap so the JVM memory settings don't apply. 6GB is most likely way to big for the instance, I'd scale it back to the defaults or if you notice memory pressure to say 1.5 GB at most.

How much memory is left on the box?

Cheers,

Stefan

Hi Bruno,

You can refer to this documentation for Scaling Stash. One line to take note in the documentation:

The memory consumption of Git is not managed by the memory settings in setenv.sh or setenv.bat. The Git processes are executed outside of the Java virtual machine, and as a result the JVM memory settings do not apply to Git.

Regards,

Deric

Suggest an answer

Log in or Join to answer
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...

661 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot