Lan Squid Proxy+Increase Memory
Where can I increase memory for Squid cache. And can I tell squid not to drop the cache every day, or not to deleate some stuff all all after it has been cached?
|
well just incease memory in your squid box squid will automatically use it on demand.
squid is not delete object from cache untill and unless is not changed on original server so if object is changed on server then squid will fetch the new copy of an object. for more squid related FAQ pls point your browser to http://squid-cache.org/ regards |
u can define how much disk space will be used in squid.conf. also u can define how much of RAM will be used! (give the 1/3 of RAM space which is used by squid). but i dont think that u can tell squid not to delete all cached stuff. because squid will always delete the rarely used cached stuff first, if the cache space is full. but it will always keep the most used stuffs in cache.
Code:
cache_dir ufs /var/spool/squid 100 16 256 /var/spool/squid : where the cache directory is sitting 100 : cache size 100 MB 16 : the number of first directories in /var/spool/cache 256 : the number of subdirectries under each that 16 directories dont choose very high cache size. it will make your proxy slower. good luck |
squid will use about 10MB per GB swap_cache to keep a internal list of stored files.
# cat squid.conf | grep cache_dir cache_dir diskd /cache/squid01 900 16 256 cache_dir diskd /cache/squid02 900 16 256 the cache_mem is for in-transmit objects and should be ~10-25% of total ram (on a busy machine) # cat squid.conf | grep cache_mem cache_mem 96 MB to specify how long things are stored use the refresh_pattern in your config. # cat squid.conf | grep pattern refresh_pattern ^ftp: 10080 20% 10080 refresh_pattern ^gopher: 10080 0% 10080 refresh_pattern -i \.gif 15 75% 43200 refresh_pattern -i \.tif 10080 75% 43200 reload-into-ims refresh_pattern -i \.bmp 10080 75% 43200 reload-into-ims refresh_pattern -i \.jpg 10080 75% 43200 reload-into-ims refresh_pattern -i \.png 15 75% 43200 reload-into-ims refresh_pattern -i \.pdf 10080 100% 43200 reload-into-ims refresh_pattern -i \.exe 10080 100% 43200 reload-into-ims refresh_pattern -i \.zip 10080 100% 43200 reload-into-ims refresh_pattern -i \.gz 10080 100% 43200 reload-into-ims refresh_pattern -i \.rar 10080 100% 43200 reload-into-ims refresh_pattern -i \.ace 10080 100% 43200 reload-into-ims refresh_pattern -i \.js 4320 50% 10080 refresh_pattern -i \.css 4320 50% 10080 refresh_pattern -i \.swf 4320 50% 10080 reload-into-ims refresh_pattern -i \.htm 120 50% 10080 reload-into-ims refresh_pattern -i \.html 120 50% 10080 reload-into-ims refresh_pattern . 0 50% 10080 use memory_pools and eventually limit them to ~96MB sl mritch. |
All times are GMT -5. The time now is 11:00 PM. |