LWN.net Logo

Squid as a cache for APT

Squid as a cache for APT

Posted Oct 13, 2005 17:43 UTC (Thu) by szoth (subscriber, #14825)
In reply to: Update in the background by csamuel
Parent article: Review: Ubuntu 5.10 Breezy Badger (Linux.com)

Set maximum object size in squid.conf to the size of the largest dpkg you wish to cache.

http://wiki.squid-cache.org/config/maximum_object_size

In my setup I had two gigs of RAM, so I also increased maximum object size
in memory.

http://wiki.squid-cache.org/config/maximum_object_size_in...

Then you probably want to use the LFUDA cache replacement policy to get a better byte hit rate.

http://squid.visolve.com/squid/squid24s1/cache_size.htm#c...

There's also a policy decision for memory replacement; I used LFUDA here too because of my large supply of RAM and willingness to suffer higher latency for some small files in return for better overall download speed.

http://squid.visolve.com/squid/squid24s1/cache_size.htm#m...

On your clients put a line like this in /etc/apt/apt.conf

Acquire::http::Proxy "http://proxy.mydomain.com:8080";

apt.conf usually doesn't exist yet, so you will have to create it, with just that line in it. Without editing apt.conf you can also use the http_proxy environment variable before running apt-get, e.g.:

export http_proxy="http://proxy.mydomain.com:8080"
apt-get update


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.