Squid Proxy Maximum object size



  • Hi all,

    I'm just wondering if any of you have experienced better/faster results from your Squid proxies by tweaking certain settings, specifically for you gamers and online video (Hulu, Netflix, YouTube) streamers.

    I noticed in the settings that the Maximum object size defaults to 4 and it says "Objects larger than the size specified (in kilobytes) will not be saved on disk. If you wish to increase speed more than you want to save bandwidth, this should be set to a low value" which to me says that any object larger than 4 kilobytes will not be cached. However, on the Squid website (http://www.squid-cache.org/Doc/config/maximum_object_size/), it says that the default is 4 MB. Should I at least change the 4 KB to 4 MB? While I am more interested in speed than bandwidth savings, only caching files less than 4 KB in size seems almost pointless.



  • I think the default is 4096 KB for that option. (not 4 KB)

    I don't optimize for streaming… (https and certificates)
    If you cache streaming set this to "large", but remember you need the large disc cache size and RAM to spare.
    (it will overshoot what you think is the max amount of RAM that squid will use very quickly with multiple streams)

    My recommendation, for normal web cache, is to set that value to the default of 4096 KB.

    However if you have some RAM to spare I recommend to set the "Maximum object size in RAM" to a larger value than the average object size on a web page.
    So this means it should be set a bit higher that the default of 32 KB.

    Example if you set up the "cachemgr.cgi" in the web interface.
    The general run-time information of the "cachemgr.cgi" page will tell you the mean object size of your cache.
    "Mean Object Size: 104.59 KB" (after 9 days of use, for my situation, which is home use)

    I've set this value to 256 KB (up from 32 KB) and it seems I could get away with setting it to 128 KB (still larger than the mean object size)

    So tweaking the squid settings depends heavily on how you use it. There is no general setting that will cover all uses.



  • I think the default is 4096 KB for that option. (not 4 KB)

    Thanks for the info, I'll go ahead and change the Maximum object size to 4096 instead of 4, not too sure why it just defaulted to 4 there, maybe it's a bug in pfSense 2.1.4? Either that or it's actually in MB but they forgot to update the description, which kind of worries me because I certainly don't want to change the cache to 4096 MB!

    However if you have some RAM to spare I recommend to set the "Maximum object size in RAM" to a larger value than the average object size on a web page.

    My pfSense box has a dual-core 2.7 GHz processor, 2 GB DDR3 RAM, and 60 GB SSD so I should have plenty of memory and storage I think.

    Example if you set up the "cachemgr.cgi" in the web interface.

    How do you go about setting this up? I didn't see this anywhere.



  • I don't believe this had a separate topic in the old forum, here is a summary of the steps.

    The cachemgr.cgi page is a symbolic link to the file in the PBI folder.
    And external cache manager as your local box in the squid config.

    You create a symbolic of "cachemgr.cgi" in the /usr/local/www folder.
    Link that to "/usr/pbi/squid-amd64/libexec/squid/cachemgr.cgi" (or i386 when you installed 32-bit pfsense)

    Then add your pfsense box ip as a external cache manager in the Proxy server -> local cache ->"External Cache-Managers"
    (it works for me)

    Then you should be able to browse to http://pfsense-ip/cachemgr.cgi (login info is the same as the pfsense gui)

    (or you could need to edit "/usr/pbi/squid-amd64/etc/squid/cachemgr.conf" and change localhost to your pfsense-ip)

    With https you may need to add the portnumber https://pfsense-ip:666/cachemgr.cgi (whatever port your pfsense https responds to)