git daemon slow first request on ubuntu 14.04

187 Views Asked by At

I've got a couple of ubuntu 14.04.1 boxes running on an vmware esxi rig.

On one server I am running a git-daemon:

sudo git daemon --base-path=. --enable=receive-pack --export-all --verbose

The other server is used as a git "client". Git version is 1.9.1 on both machines.

On the "first" (see further details below) request to the git-daemon a simple git pull and push with no changes takes 5 seconds to execute. If I then issue another one straight after it is fast (~80ms).

What I have noticed is that it appears to be fast whenever there is still a TCP connection in some kind of active state (TIME-WAIT) on the client machine. Once all tcp connections to the git-daemon disappear completely from (ss -atp) the next git pull or push request is slow then followed by fast once etc.

Although I don't have enough boxes to confirm, this issue appears not to happen on ubuntu 12 with git 1.7.8

Also it does not happen if I use the git client from the machine running the daemon.

Any advice would be greatly appreciated. Karl

0

There are 0 best solutions below