]> Sergey Matveev's repositories - public-inbox.git/commit
git-http-backend: reduce memory use for clone/fetch
authorEric Wong <e@80x24.org>
Tue, 3 May 2016 02:34:57 +0000 (02:34 +0000)
committerEric Wong <e@80x24.org>
Tue, 3 May 2016 09:12:42 +0000 (09:12 +0000)
commit1bd4f49d3e6e19f71d170058cc8c6cb466dc5b9f
tree966c920f4bbb367cf43af4ab997ec2eabe789bd3
parentce44148b662558922523465f29d372912b7c6a61
git-http-backend: reduce memory use for clone/fetch

When serving large static files or large packs, we may call
Danga::Socket::write directly to queue up callbacks to resume
reading and defer firing them until the socket is writable.
This prevents us from scheduling writes or buffering until we
know the socket is writable and prevents needless buffering by
Danga::Socket when faced with slow clients.

For smart clones, this comes at the cost of throttling the
output of "git pack-objects" to the speed of the client
connection.  This is probably not ideal, but is the behavior of
the standard git-daemon, too; and is preferable to running the
httpd out-of-memory.  Buffering to the filesystem may be an
option in the future...
lib/PublicInbox/GitHTTPBackend.pm
t/git-http-backend.psgi [new file with mode: 0644]
t/git-http-backend.t [new file with mode: 0644]