lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] /etc/etckeeper/.git became enormous


From: Vadim Zeitlin
Subject: Re: [lmi] /etc/etckeeper/.git became enormous
Date: Tue, 13 Sep 2022 20:16:27 +0200

On Tue, 13 Sep 2022 15:50:43 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:

GC> It seems that etckeeper might never trigger garbage collection.

 This might well be true, but if you use Git enough times interactively
(and I often commit using it directly after making some changes in /etc),
it should still happen. Would you have any non-default gc-related objects
set by chance, e.g. gc.auto=0 or anything like that? Or is it only done
automatically by the Git versions newer than the one installed on the
server (I couldn't find quickly what was the first version which started
running it automatically, but it changed a very long time ago). Or is it
just due to you never running git directly?

GC> On a corporate server:
GC> 
GC> du -sh /etc/.git/objects/
GC> 11G     /etc/.git/objects/
GC> 
GC> git gc
GC> 
GC> du -sh /etc/.git/objects/
GC> 44M     /etc/.git/objects/

 Wow. I'm using etckeeper on dozens of machines and I didn't check all of
them, but I've checked half a dozen and they all were between 10 and 64M
before running git-gc and went down to between 5 and 40M afterwards. I
can't even imagine what must have happened in order to have it grow to 11G.

GC> I created a script to automate this, following the advice here:
GC> 
GC> 
https://www.turnkeylinux.org/forum/support/20111111/etckeeper-has-huge-git-repo-how-remove
GC> 
GC> #cat /etc/etckeeper/post-install.d/99git-gc
GC> #!/bin/sh
GC> exec git gc

 FWIW running it every time seems a bit wasteful for me and I'd probably do
it from a cron job or systemd timer, but it shouldn't be a big problem in
practice, of course.

 I'm still more curious how did it end up at 11G and why didn't git-gc run
automatically anyhow...

VZ

Attachment: pgpjAti_RO8bQ.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]