【发布时间】:2015-11-16 17:41:33
【问题描述】:
我有一个使用 Atlassian Stash 的小型 Git 存储库。该 repo 有大约 250 个文件,历史不多,而且文件都很小 - 总 repo 大小约为 10MB。
在许多情况下,Git pull(仅返回“已经是最新的”)超过 8 秒。
设置 GIT_TRACE 后,显示如下:
23:35:25.109710 git.c:555 trace: exec: 'git-pull'
23:35:25.109745 run-command.c:351 trace: run_command: 'git-pull'
23:35:25.122176 git.c:346 trace: built-in: git 'rev-parse' '--git-dir'
23:35:25.131460 git.c:346 trace: built-in: git 'rev-parse' '--is-bare-repository'
23:35:25.132926 git.c:346 trace: built-in: git 'rev-parse' '--show-toplevel'
23:35:25.134679 git.c:346 trace: built-in: git 'ls-files' '-u'
23:35:25.136349 git.c:346 trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
23:35:25.139419 git.c:346 trace: built-in: git 'config' 'branch.master.rebase'
23:35:25.142520 git.c:346 trace: built-in: git 'config' 'pull.rebase'
23:35:25.144089 git.c:346 trace: built-in: git 'config' 'pull.ff'
23:35:25.145995 git.c:346 trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
23:35:25.147660 git.c:346 trace: built-in: git 'fetch' '--update-head-ok'
23:35:25.148347 run-command.c:351 trace: run_command: 'ssh' '-p' '7999' 'git@smsvcs' 'git-upload-pack '\''/srm/srm.git'\'''
23:35:31.758436 run-command.c:351 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
23:35:31.761165 run-command.c:351 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all'
23:35:31.761307 exec_cmd.c:129 trace: exec: 'git' 'rev-list' '--objects' '--stdin' '--not' '--all'
23:35:31.762459 git.c:346 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all'
23:35:33.806938 run-command.c:351 trace: run_command: 'gc' '--auto'
23:35:33.807048 exec_cmd.c:129 trace: exec: 'git' 'gc' '--auto'
23:35:33.808245 git.c:346 trace: built-in: git 'gc' '--auto'
23:35:33.809709 git.c:346 trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
23:35:33.813711 git.c:346 trace: built-in: git 'fmt-merge-msg'
23:35:33.818468 git.c:346 trace: built-in: git 'merge' 'Merge branch '\''master'\'' of ssh://smsvcs:7999/srm/srm' 'HEAD' 'f77e569b202ef7674dc30d219e71b2587e87f708'
Already up-to-date.
最大的延迟似乎发生在 23:35:25.148347,同时它正在通过 SSH 运行 git-upload-pack(它需要超过 6.5 秒)。
SSH 连接非常快:
=->time ssh xyz@smsvcs 'echo test'
test
real 0m0.136s
user 0m0.009s
sys 0m0.001s
第二大延迟是在 23:35:33.806938,它是 2 秒 - 运行 rev-list。
这是在 Red Hat Enterprise Linux Server 版本 5.11 (Tikanga) 上, git 版本 2.3.2
任何想法可能导致这些性能问题,或者如何进一步排除故障?
【问题讨论】:
-
您使用的是什么 Git 版本和操作系统?您的本地克隆是存储在本地磁盘上还是网络路径上?
-
@VonC:本地克隆存储在本地磁盘上
-
好的。您使用的是什么 Git 版本和操作系统?
-
谁否决了我的问题,请提供原因。我遇到了 Atlassian Stash/git 性能问题,我正在尝试解决它,但我被卡住了。为什么投反对票?
-
我没有投反对票,为了记录。但我仍然想知道您使用的是什么 Git 版本和操作系统。
标签: git git-pull bitbucket-server