Git: slow collecting changes after large branch merge
Hi,
we use TeamCity 2017.1.1 with Git (Github) VCS and sometimes we merge a dev branch to the master branch and this brings a lot of changes to the master.
For instance, last time we merged 4K+ changes. The issue is that it took more than hour for TeamCity to detect the changes. During that time TeamCity used 50-100% of CPU.
As far as I understand from logs and dumps, this is not git.exe operations. On the Diagnostics -> VCS Status page I saw that there is a thread with "in progress" VCS operation and thread dump (multiple dumps actually) showed that the thread is at "at org.eclipse.jgit.internal.storage.file.PackFile.get(PackFile.java:258)". The complete thread dump was uploaded to FTP as 1.txt
By the way, the build agent is located on dedicated VM, but the slowness is on TeamCity itself.
Question: is it expected behaviour for such large change sets? Is it possible to speed it up?
Please sign in to leave a comment.
Hi Alex,
The line you mention seems to indicate that jgit is the library taking the longest, then I don't think there is much we can do from teamcity's side, and it will also depend on what kind of changes there are. Still, I'm going to pass this to our git maintainer to review whether something can be done from our side to improve it.
Hi Alex,
do you have git gc enabled on TeamCity server? If not, please check if enabling it helps.
We've updated to 2017.2.4 (build 51228) (documentation says it includes git gc automatically), but anyway it takes about 40 minutes for TC to "notice" about 2K changes.
Do you have any ideas what can be done?
Please provide teamcity-cleanup.log, teamcity-vcs.log, teamcity-vcs-states.log, and ID of the VCS root where checking for changes is slow