Improving speed of checkout from git (from github)
Asked Answered
W

2

6

I'm using git and TeamCity v6.0 in a Windows environment.

I have just switched over from server side checkouts to checkout on agents because of IO issues, however...

Initial checkout has become exceeding slow from ~ a minute to >45 minutes. Once the repo is cloned everything is OK. Is there some configuration on the agents I can tweak to improve this? Thanks for any replies in advance.

What I see is the initial git files created on the agent and then there is a very long pause and then I get all my data. I can see from the process explorer that git appears to be doing very little and there is no obvious source of throttling.

Westmoreland answered 3/4, 2012 at 13:57 Comment(0)
K
11

One thing that can cause a slowdown is java ssh implementation used with agent-side checkout, to turn it off set an agent property teamcity.git.use.native.ssh=true.

Also you can set an agent property teamcity.git.use.local.mirrors=true, in this case TeamCity will create a bare clone of your repository and will update build directory from this bare clone instead of github, i.e. initial clone will be done only once.

Kant answered 3/4, 2012 at 18:13 Comment(8)
ill give it a go and let u know how i get on.Westmoreland
@JamesWoolfenden How did you get on?Aretino
Nothing helped, unfortunately we are lumbered.Westmoreland
@JamesWoolfenden even local mirrors didn't help? This is strange, since with mirrors it is just clone from one folder to another on the same machine.Kant
Everytime i edited the vcs settings TC recreated the repo. So it became an extremely expensive waste of time to investigate. I saw a 10%-20% improvement but was still taking ~hour to sync a repo. Once i have the repo further checkouts are okish. Not quick.Westmoreland
@JamesWoolfenden git on agent use one repository per VCS root url, so TeamCity shouldn't recreate a repo unless you edited the urlKant
@JamesWoolfenden my bad, build checkout directory changes if you edit a VCS root, but if you use local mirrors it results only in clone from a local file system, this shouldn't take an hour. It would help if you can provide teamcity-vcs.log with the slow checkouts.Kant
@Kant that issue is four contracts ago... we migrated to using local git master instead of github. we also had a surfeit of agents.Westmoreland
V
0

If it's fast on another configuration, your problem is not git or github, but the size of the pipe running into the machine.

If you are using TeamCity in the cloud, you will need to talk to JetBrains about their bandwidth. If locally, talk to your sysadmins.

Vizor answered 3/4, 2012 at 14:7 Comment(5)
Hi Matt, not using TC in the cloud. Same pipe available on the agents as the server previously.Westmoreland
Odd. Are they on the same network segment? Possibly firewall is configured differently.Vizor
Very strange. How does ping look from server to repo? Could be that DNS is iffy.Vizor
both are locked down in the same way no . I hoped it was something to do with repo size or suboptimal vcs settings.Westmoreland
Eventually we moved from github to local git, this helped, not that the problem was github per se, just that it was a remote repo.Westmoreland

© 2022 - 2024 — McMap. All rights reserved.