Install squid caching server to reduce build time
Building using mock will trigger downloads of many RPMs from CentOS and Fedora mirrors each time the chroot initialized, which is often enough. If you install a caching proxy server, then RPMs are only downloaded once then cached on your local network. This will speed build times up substantially after running through a complete build once.
yum install squid
I recommend these settings in file /etc/squid/squid.conf
for optimal caching
# 10G Cache cache_dir ufs /var/spool/squid 10000 16 256 # Cache large files maximum_object_size 512000 KB
Then call
service squid start chkconfig squid on
To tell sipXecs build scripts to use your caching proxy, just add this configure switch when preparing to build sipXecs
./configure ... --with-yum-proxy=http://localhost:3128
.
You can verify caching is working by your second build by looking for the string TCP_MEM_HIT
in /var/log/squid/access.log
.
You can use your new caching server to install systems faster as well. This is handy if you maintain a lot of systems, or test installations a lot. To use the proxy, edit /etc/yum.conf
and add the setting proxy=http://your-squid-server:3128
to the main
section. Then comment out lines starting with mirrorlist=
and uncomment out lines #baseurl
. The reason you should use baseurls is so that you are consistently going to the same source for files and squid proxy will know to cache.
There is one issue, you must pick a mirror site that uses cache headers so squid knows caching is valid.