[PATCH] hgweb: config option to control zlib compression level
Anton Shestakov
engored at ya.ru
Mon Aug 8 01:31:05 UTC 2016
08.08.2016, 09:12, "Gregory Szorc" <gregory.szorc at gmail.com>:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1470618598 25200
> # Sun Aug 07 18:09:58 2016 -0700
> # Node ID d5e9dedbc7f912ff2dc2e92586347250aee11ac2
> # Parent 3ef9aa7ad1fc4c43b92d48e4bb1f4e3de68b6910
> hgweb: config option to control zlib compression level
>
> Before this patch, the HTTP transport protocol would always zlib
> compress certain responses (notably "getbundle" wire protocol commands)
> at zlib compression level 6.
>
> zlib can be a massive CPU resource sink for servers. Some server
> operators may wish to reduce server-side CPU requirements while
> requiring more bandwidth. This is common on corporate intranets, for
> example. Others may wish to use more CPU but reduce bandwidth.
>
> This patch introduces a config option to allow server operators
> to control the zlib compression level.
>
> On the "mozilla-unified" generaldelta repository, setting this
> value to "0" (disable compression) results in server-side CPU
> utilization for a `hg clone` going from ~180s to ~124s CPU time on
> my i7-6700K. A level of "1" (which increases the transfer size from
> ~1,074 MB at level 6 to ~1,222 MB) utilizes ~132s CPU time.
Looks good to me.
Does memlevel argument to zlib.compressobj look interesting? The docs say "higher values use more memory, but are faster and produce smaller output", maybe bumping it to 9 from the default 8 would also lower CPU time.
More information about the Mercurial-devel
mailing list