git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Multiple threads of compression

From
Brandon Casey <drafnel@gmail.com>
Date
Nov 26, 2012, 02:37 UTC
Message-ID
<CA+sFfMerMWnJwiBz0=MxO0gn8B2M8g12mt5VzZaRj591oMPVow@mail.gmail.com>
In-Reply-To
<loom.20121125T171702-64@post.gmane.org>
On Sun, Nov 25, 2012 at 8:27 AM, Thorsten Glaser <tg@debian.org> wrote:
Show 5 quoted lines
> tl;dr: I would like to have a *global* option for git to restrict
> the number of threads of execution it uses. Several subcommands,
> like pack-objects, are already equipped with an optioin for this,
> but unfortunately, these are seldom invoked by hand¹, so this can’t
> work in my situations.
See the git-config man page.

The number of threads that pack uses can be configured in the global or system gitconfig file by setting pack.threads.

e.g.
   $ git config --system pack.threads 1

Also, modern git accepts a '-c' option which allows you to set configuration options on the command line, e.g. 'git -c pack.threads=1 gc'.

The other setting you should probably look at is pack.windowMemory which should help you control the amount of memory git uses while packing. Also look at core.packedGitWindowSize and core.packedGitLimit if your repository is really large.

Show 8 quoted lines
>
> ① automatic garbage collection, “git gc --aggressive --prune=now”,
>   and cloning are the use cases I have at hand right now.
>
> À propos, while here: is gc --aggressive safe to run on a live,
> online-shared repository, or does it break other users accessing
> the repository concurrently? (If it’s safe I’d very much like to do
> that in a, say weekly, cronjob on FusionForge, our hosting system.)

Running 'git gc' with --aggressive should be as safe as running it without --aggressive.

But, you should think about whether you really need to run it more than once, or at all. When you use --aggressive, git will perform the entire delta search again for _every_ object in the repository. The general usecase for --aggressive is when you suspect that the original delta search produced sub-optimal deltas or if you modify the size of the delta search window or depth and want to regenerate your packed objects to improve compression or access speed. Even then, you will not likely get much benefit from running with --aggressive a second time.

hth, -Brandon

Previous: Thorsten GlaserNext: Thorsten Glaser
Message 2 of 4 in “Multiple threads of compression”
  1. Thorsten GlaserNov 25, 2012
  2. Brandon CaseyNov 26, 2012
  3. Thorsten GlaserNov 26, 2012
  4. Sebastian LeskeNov 26, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.