Svn – Avoid double (de)compression in Subversion with Apache

apache-2.2compressionsvn

I have a Subversion 1.8 server configured with Apache 2.2 on windows 2003.
The server I have is a little bit old and it has a lot of CPU peaks that I suspect are affecting its performance.

This server is entirely dedicated to subversion.

While I do want to have data compression over network (input and output), I want to avoid double (de)compression in this server.

Right now I'm using the following 2 directives.

SVNCompressionLevel 5
SetOutputFilter DEFLATE

I thought about disabling one of then but I could not find any recommendation on which one is better. I want to have client to server compression too. I thought about using one of these 2 options:

# Let only mod_dav_svn handle compression
SVNCompressionLevel 5
# no SetOutputFilter or SetInputFilter

or

# Let only mod_deflate handle compression
SVNCompressionLevel 0
SetOutputFilter DEFLATE
SetInputFilter DEFLATE        #(new idea)

I'm not sure if the subversion client will compress its data to server if I just add 'SetInputFilter DEFLATE' in the server.

Does someone have more information on that?

Best Answer

You're almost right and correct solution to avoid double compression is:

# Let only mod_deflate handle compression
SVNCompressionLevel 0
SetOutputFilter DEFLATE

It disables SVN compression for deltas while enabling HTTP compression for all responses.

But there are several caveats:

  1. Subversion client doesn't compress HTTP request body since it doesn't know whether compression is supported by server. So SetInputFilter DEFLATE is not needed.

  2. Apache HTTP Server has a memory leak in mod_dav/mod_deflate when compression is enabled, while didn't advertised that it supports HTTP compression.

Also you should consider to perform dump/load your repository to improve performance -- new formats adds some indexing/shortcuts that's help sever spend less resources.

Related Topic