Re: Slow git pack-refs --all
From: Martin Fick <hidden>
Date: 2026-01-07 17:05:56
From: Patrick Steinhardt <redacted> Sent: Monday, January 5, 2026 11:53 PM On Mon, Jan 05, 2026 at 11:45:41PM +0000, Martin Fick wrote:quoted
OK, after discovering the strace -r and -T options, I have determined that the 29K writes were all very fast in themselves. However, most of the writes seem to follow each other with no other system calls in between. This explains why it looks like the writes are slow, even though they aren't.quoted
If I tally up the time between the previous system call, and each write(), it adds up to the bulk of the time (4mins out of 4m15s) that it takes to pack refs. This tells me that no visible I/O or system calls are the problem, but rather that the program itself is taking a long time between writes. I very much doubt that this is heavy CPU time, but rather I am going to guess that this is hidden system time spent accessing mmaped memory. Could it be really slow reading the packed-refs file? I can see the packed-refs file is mmaped() before the writes start, and then munmapped after the writes are completed. If I had to guess, that likely means that the packed-refs file is being read in small increments by the kernel via mmap, and that is what is making things very slow over NFS.... Do you use any special flags for mounting the NFS filesystem?
Oh sorry, I forgot to reply to this last time. We use the following mount flags: rw,intr,retrans=10,timeo=600,hard,rsize=32768,wsize=32768,tcp,noacl,_netdev -Martin