# performance issue: git clone compression

4 messages from 2009-11-08 to 2009-11-08. Participants: Tim Webster, Nicolas Pitre.
Thread: https://gitlist.dev/t/21526

## Tim Webster, 2009-11-08 01:09

Subject: performance issue: git clone compression
Message-ID: <72877ab10911071709s200696d4mf12dc797da20be18@mail.gmail.com>
URL: https://gitlist.dev/e/72877ab10911071709s200696d4mf12dc797da20be18%40mail.gmail.com
In-Reply-To: <72877ab10911071657p568b3b98v6fd90e84e098c107@mail.gmail.com>

```
git clone gitosis@gitserver:code.git

After remote counting objects, remote compressing objects
transfer begins...
This compression operation results in excess of swapage on the remote server.

--------------------

I need to avoiding the clone compression step for servers with limited memory.
I am doing the following to avoid this object compression. Is there a
better way?
-------------------

scp -r gitserver:/srv/gitosis/repositories/code.git  .
git clone /tmp/junk/code.git --no-hardlinks code
# IS there a better way of converting the bare git repository to
working git repository?

edit .git/config
url = gitosis@gitserver:code.git

```

## Nicolas Pitre, 2009-11-08 02:17

Subject: Re: performance issue: git clone compression
Message-ID: <alpine.LFD.2.00.0911072115270.16711@xanadu.home>
URL: https://gitlist.dev/e/alpine.LFD.2.00.0911072115270.16711%40xanadu.home
In-Reply-To: <72877ab10911071709s200696d4mf12dc797da20be18@mail.gmail.com>

```
On Sat, 7 Nov 2009, Tim Webster wrote:

> git clone gitosis@gitserver:code.git
> 
> After remote counting objects, remote compressing objects
> transfer begins...
> This compression operation results in excess of swapage on the remote server.
> 
> --------------------
> 
> I need to avoiding the clone compression step for servers with limited memory.

Make sure the remote repository is fully packed.  To do so, just go into
the remote repository and run 'git gc'.


Nicolas

```

## Tim Webster, 2009-11-08 02:45

Subject: Re: performance issue: git clone compression
Message-ID: <72877ab10911071845q1c60e2b0kfe6f0509b5728912@mail.gmail.com>
URL: https://gitlist.dev/e/72877ab10911071845q1c60e2b0kfe6f0509b5728912%40mail.gmail.com
In-Reply-To: <alpine.LFD.2.00.0911072115270.16711@xanadu.home>

```
On servers with limit memory it is not piratical to run git gc.
I can run git gc on a bare mirror and rsync back to the server.

I would prefer to for go compress packing entirely for the large git
repositories containing media files.

Can I disable compression by file attribute via .gitattributes?

I am trying to use git for all repositories to avoid a mix of version
control methods.
For media repositories I am using

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    compression = 0
    loosecompression = 0

[pack]
    # disable delta-based packing
    depth = 1
    # disable compression
    compression = 0

There is no problem with git pull and push
Just git clone swaps the server to death



> Make sure the remote repository is fully packed.  To do so, just go into
> the remote repository and run 'git gc'.
>
>
> Nicolas
>

```

## Nicolas Pitre, 2009-11-08 03:04

Subject: Re: performance issue: git clone compression
Message-ID: <alpine.LFD.2.00.0911072155180.16711@xanadu.home>
URL: https://gitlist.dev/e/alpine.LFD.2.00.0911072155180.16711%40xanadu.home
In-Reply-To: <72877ab10911071845q1c60e2b0kfe6f0509b5728912@mail.gmail.com>

```
On Sat, 7 Nov 2009, Tim Webster wrote:

> On servers with limit memory it is not piratical to run git gc.
> I can run git gc on a bare mirror and rsync back to the server.

That is fine.  As long as you end up with a single pack, then a clone 
would basically be a sinple file transfer.

Also you might want to investigate the following config variable for a 
low-memory server:

	core.packedGitWindowSize
	core.packedGitLimit
	pack.windowMemory
	pack.deltaCacheSize
	pack.deltaCacheLimit


Nicolas

```
