如何令Squid每天自動清除Cache?



贊助商連結


rainfile
2002-06-25, 08:44 AM
我發現我的Squid每兩天便要清除一次Cache,否則User利用Squid瀏覽網頁時就會很慢(超過1分鐘)。

現在必須每隔兩天要清除一次Cache,我是使用Squid State1 2.4版。
請問可那方法令Cache每天清除cache一次,另外,我的Squid 是不是有問題?

贊助商連結


repsol
2002-06-25, 10:45 AM
不知道這個是不是你要的ㄟ


vi /usr/local/squid/etc/squid.conf

# TAG: reference_age
# As a part of normal operation, Squid performs Least Recently
# Used removal of cached objects. The LRU age for removal is
# computed dynamically, based on the amount of disk space in
# use. The dynamic value can be seen in the Cache Manager 'info'
# output.
#
# The 'reference_age' parameter defines the maximum LRU age. For
# example, setting reference_age to '1 week' will cause objects
# to be removed if they have not been accessed for a week or
# more. The default value is one year.
#
# Specify a number here, followed by units of time. For example:
# 1 week
# 3.5 days
# 4 months
# 2.2 hours
#
# NOTE: this parameter is not used when using the enhanced
# replacement policies, GDSH or LFUDA.
#
#Default:
# reference_age 1 year

rainfile
2002-06-25, 11:38 AM
# TAG: reference_age
# As a part of normal operation, Squid performs Least Recently
# Used removal of cached objects. The LRU age for removal is
# computed dynamically, based on the amount of disk space in
# use. The dynamic value can be seen in the Cache Manager 'info'
# output.
#
# The 'reference_age' parameter defines the maximum LRU age. For
# example, setting reference_age to '1 week' will cause objects
# to be removed if they have not been accessed for a week or
# more. The default value is one year.
#
# Specify a number here, followed by units of time. For example:
# 1 week
# 3.5 days
# 4 months
# 2.2 hours
#
# NOTE: this parameter is not used when using the enhanced
# replacement policies, GDSH or LFUDA.
#
#Default:
reference_age 2 days

是不是改成這樣子?

repsol
2002-06-25, 03:41 PM
影響squid效能有蠻多的參數
先找出慢的問題點...再來調整squid.conf的設定


reference_age 2 days
#The 'reference_age' parameter defines the maximum LRU age. For
# example, setting reference_age to '1 week' will cause objects
# to be removed if they have not been accessed for a week or
# more. The default value is one year.
這個參數的用意 , 是說放在cache裡的資料如果兩天之內沒有被client端access的話
squid就會從cache中清除


http://squid.visolve.com/squid24s1/


這邊有很完整的doc...


你可以看看第VI章節參考一下