Tuesday, February 7, 2017

pfsense Squid Proxy Settings (Tuning)

Squid Proxy


SQUID PROXY SETTINGS

General Settings are now done. So save’ em and move on to the Cache Management Tab.

We need to do some math before we determine cache size values. The temptation, since we have gobs of our 250 GB disk available, is to use a large chunk for web caching. The thing is that Squid uses an in-memory
index to address the cache. So it is best to balance memory against disk cache size.

The Squid User Guide recommends 5 MB of memory for every Gigabyte of disk cache (you don’t want to be thrashing, incurring a high swap rate). So determine how many megabytes of memory you have to spare for caching, divide that by 5, and you have the number of Gigabytes you should allocate to your cache.


With Cerberus under load and largely due to Snort, I run at 80% memory usage (according to Diagnostic->System Activity), giving me about 600 MB free. I want some headroom for processing peaks, about half, so I have 300 MB available for my in-memory cache. Dividing that by the 5 to 1 guideline, I end up with a disk cache size of 60 GB.

Having calculated our sizes, we are ready to fill in the Cache Management configuration tab values, as summarized.

HARD DISK CACHE SIZE: 61400
HARD DISK CACHE LOCATION: /var/squid/log
MEMORY CACHE SIZE: 300
MINIMUM OBJECT SIZE: 0 (no limit)
MAXIMUM OBJECT SIZE: 256

No comments:

Post a Comment