如何令Squid每天自動清除Cache? - PCZONE 討論區

返回   PCZONE 討論區 > ▲ -- 電 腦 軟 體 討 論 區 > -- FreeBSD & Linux 討 論 版


PCZONE 討論區



通知

-- FreeBSD & Linux 討 論 版 因為本站採用 FreeBSD 作業系統,所以自己本身也多學了一些技巧,希望各位在這裡互相討論 Unix 作業系統及程式等相關問題。

會員
如何令Squid每天自動清除Cache?
我發現我的Squid每兩天便要清除一次Cache,否則User利用Squid瀏覽網頁時就會很慢(超過1分鐘)。

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

回覆
進階會員

不知道這個是不是你要的ㄟ


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
回覆
會員

# 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

是不是改成這樣子?
回覆
進階會員

影響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章節參考一下

回覆







 XML   RSS 2.0   RSS 
本站使用 vBulletin 合法版權程式
站務信箱 : [email protected]

本論壇所有文章僅代表留言者個人意見,並不代表本站之立場,討論區以「即時留言」方式運作,故無法完全監察所有即時留言,若您發現文章可能有異議,請 email :[email protected] 處理。