Skip to content

"git commit" of single file takes 5 minutes, mounted fileystem/diskimage with 50G GIT repo + 900G of builds articles #3797

@sarvi

Description

@sarvi

gitcommitexp.log
Some context
We have a 50G GIT/GIT-LFS based repository. We then build about 900G of build articles.
To accelerate development, we copy this workspace into a EXT4 formatted disk image and snapshot it
Developers clone this disk image quickly, mount it and they have a fully built workspace that they can do incremental builds on.

Problem 1: resolved
after mounting the diskimage, "git status" and "git diff" used to take 40 minutes.
After some discussions on thhe GIT alias, I was asked do a "git update-index --refresh" after copying over the GIT workspace to the diskimage. It was suggested that the git-index that tracks source tree information included node information that would not be valid after it GIT wokspace was copied into a new filesystem.
So we now do a "git update-index --refresh" in the diskimage after git workspace copy and before we snapshot. After this the cloned/mounted diskimage performed better. First time "git status/diff" is now down to 1m30 seconds, subsequence commands were always in <10 seconds.

GIT Thread: https://marc.info/?t=156649700700001&r=1&w=2

Problem 2:
Now in the above workspace, if I now try to do a local commit of a simple 1 line code change, It takes about 5 minutes.
"git commit -m "dummy commit" of a 1 line change in 1 file takes about 5-6
minutes, everytime in this workspace. Tracing shows a whole bunch.

The entire 5-6
minutes worth of the following sort of trace logs. 3:13:50.320930 trace git-lfs:
filepathfilter: rejecting "x/y/z.o.command" via [] 13:13:50.320940 trace git-lfs:
filepathfilter: accepting " x/y/z.o.command " 13:13:50.320862 trace git-lfs:
filepathfilter: rejecting "a/b/c/d.o.command" via [] 13:13:50.320972 trace git-lfs:
filepathfilter: accepting " a/b/c/d..o.command"

The git folks suggest this is not a GIT problem but might be git-lfs

These are messages from the Git LFS tool, and this list does not provide
support for Git LFS, since it is a separate project not affiliated with
Git.

I would recommend that you create an issue on Git LFS's tracker at:

https://github.com/git-lfs/git-lfs/issues/new

and mention that you are seeing lots of 'filepathfilter' logs. My
speculation is that this could be a slowdown in the 'filepathfilter'
code paths, or an entire-tree scan where 'filepathfilter' is invoked
every so often. I'd mention both of those as possibilities (or send a
link to this email on public-inbox), and see if anything comes up.

GIT Thread: https://marc.info/?t=156685229900001&r=1&w=2

Does anyone here have any idea on what might be causing this? Or how to improve on this?

I have attached portions of the log from the following git command
GIT_CURL_VERBOSE=1 GIT_TRACE=1 time git commit -m "Hello message more more" >gitcommit.log 2>&1

The full gitommit.log file is 4.5GB in size some 27M lines.
bash-4.1$ wc -l gitcommit.log
27953652 gitcommit.log

What I have attached is a representative sample, apart from file/directory names being different there isn't much else different as shown below

bash-4.1$ cat gitcommit.log | grep -v "accepting" | grep -v "rejecting" | grep -v "rewrite"
18:40:55.491599 git.c:415 trace: built-in: git commit -m 'Hello message more more'
18:40:56.356085 run-command.c:637 trace: run_command: git gc --auto
18:40:56.364464 git.c:415 trace: built-in: git gc --auto
18:40:56.366081 run-command.c:637 trace: run_command: GIT_EDITOR=: GIT_INDEX_FILE=.git/index .git/hooks/post-commit
18:40:56.376149 git.c:659 trace: exec: git-lfs post-commit
18:40:56.376212 run-command.c:637 trace: run_command: git-lfs post-commit
18:40:56.380867 trace git-lfs: exec: git 'version'
18:40:56.385136 trace git-lfs: exec: git 'config' '-l'
18:40:56.389123 trace git-lfs: exec: git 'config' '-l' '-f' '/witspace/sarvi/space_sarvi_testws1/.lfsconfig'
18:40:56.391505 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
[S2C-build-polaris_dev-95129 a9a056287365] Hello message more more
1 file changed, 1 insertion(+)
400.85user 760.46system 24:15.87elapsed 79%CPU (0avgtext+0avgdata 125756maxresident)k
10397264inputs+9425256outputs (23major+45502minor)pagefaults 0swaps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions