annotate contrib/docker/centos5 @ 29792:58467204cac0

hgweb: tweak zlib chunking behavior When doing streaming compression with zlib, zlib appears to emit chunks with data after ~20-30kb on average is available. In other words, most calls to compress() return an empty string. On the mozilla-unified repo, only 48,433 of 921,167 (5.26%) of calls to compress() returned data. In other words, we were sending hundreds of thousands of empty chunks via a generator where they touched who knows how many frames (my guess is millions). Filtering out the empty chunks from the generator cuts down on overhead. In addition, we were previously feeding 8kb chunks into zlib compression. Since this function tends to emit *compressed* data after 20-30kb is available, it would take several calls before data was produced. We increase the amount of data fed in at a time to 32kb. This reduces the number of calls to compress() from 921,167 to 115,146. It also reduces the number of output chunks from 48,433 to 31,377. This does increase the average output chunk size by a little. But I don't think this will matter in most scenarios. The combination of these 2 changes appears to shave ~6s CPU time or ~3% from a server serving the mozilla-unified repo.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 14 Aug 2016 21:29:46 -0700
parents eea2e0f76a24
children aa7a3f6e3729
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23034
eea2e0f76a24 docker: use official centos5 image
Mads Kiilerich <madski@unity3d.com>
parents: 22444
diff changeset
1 FROM centos:centos5
22443
d8818616c45e docker: add CentOS 5
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
2 RUN yum install -y gcc make rpm-build gettext tar
d8818616c45e docker: add CentOS 5
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
3 RUN yum install -y python-devel python-docutils
22444
49ea49823769 dockerrpm: create a yum/dnf repo from the generated rpms
Mads Kiilerich <madski@unity3d.com>
parents: 22443
diff changeset
4 # For creating repo meta data
49ea49823769 dockerrpm: create a yum/dnf repo from the generated rpms
Mads Kiilerich <madski@unity3d.com>
parents: 22443
diff changeset
5 RUN yum install -y createrepo
22443
d8818616c45e docker: add CentOS 5
Mads Kiilerich <madski@unity3d.com>
parents:
diff changeset
6 RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel