-
Notifications
You must be signed in to change notification settings - Fork 15
TKLDev - Squid proxy cache configuration conservative, causing a lot of cache misses #1855
Description
Hi,
I am currently again in the process of developing bitkey-ng :-) Though, I noticed, that a lot of apt downloads where not coming from the squid cache, /var/log/squid/access.log is showing a lot of cache misses.
This boils down to the configuration of the squid proxy in https://github.com/turnkeylinux-apps/tkldev/blob/7f427df9cc43dd076f67a6d2ed86cde49fa53ea3/overlay/etc/squid/squid.conf
As per squid documentation
cache_dir ufs /var/spool/squid 200 16 256
results in only a maximum of 200MB cache size on disk.
Second issue is, that there is also a maximum object size in each cache, which defaults to 4MB only, see: http://www.squid-cache.org/Doc/config/maximum_object_size/
That means every file larger than 4MB does not get cached and will always be redownloaded.
According to the docs it should be possible to increase that per cache directive using the max_size=[size] option, but I wasn't able to get that working. However, increasing maximum_object_size directly had an effect. My configuration now looks like this:
maximum_object_size 1024 MB
cache_dir ufs /var/spool/squid 2048 16 256
So resulting in a max of 2Gig cache storage, with a max of 1Gig per object. This works nicely now. If I am building a second time, no apt download is happening via the network. For (the current version of) bitkey-ng, the used cache size is around 650MB. One can view this size via du -sh /var/spool/squid/.
So I wondered: Is there a reason for this very conservative cache configuration? Would you be open to increase the numbers?
best
derMart