squid代理上网性能调优参数

squid默认安装就可以代理上网了。但是上网的速度并不是很快,我们需要对一些配置参数进行调整,让squid发挥最大的威力。

 

我们的服务器是debian 6.x系统,在系统默认的配置上面,我们做了如下修改:

 

diff --git a/squid.conf b/squid_new.confindex 216bfa7..e7ea678 100644--- a/squid.conf+++ b/[email protected]@ -601,6 +601,7 @@ acl all src all acl manager proto cache_object acl localhost src 127.0.0.1/32+#acl localnet src 192.168.0.0/24 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 # # Example rule allowing access from your local [email protected]@ -1736,6 +1737,7 @@ hierarchy_stoplist cgi-bin ? # #Default: # cache_mem 8 MB+cache_mem 16 MB  #  TAG: maximum_object_size_in_memory	(bytes) #	Objects greater than this size will not be attempted to kept [email protected]@ -1745,6 +1747,7 @@ hierarchy_stoplist cgi-bin ? # #Default: # maximum_object_size_in_memory 8 KB+maximum_object_size_in_memory 1 MB  #  TAG: memory_replacement_policy #	The memory replacement policy parameter determines [email protected]@ -1754,6 +1757,8 @@ hierarchy_stoplist cgi-bin ? # #Default: # memory_replacement_policy lru+memory_replacement_policy lru+   # DISK CACHE [email protected]@ -1796,6 +1801,7 @@ hierarchy_stoplist cgi-bin ? # #Default: # cache_replacement_policy lru+cache_replacement_policy heap LFUDA  #  TAG: cache_dir #	Usage:@@ -1943,6 +1949,7 @@ hierarchy_stoplist cgi-bin ? # #Default: # cache_dir ufs /var/spool/squid 100 16 256+cache_dir diskd /var/spool/squid 512 16 256  #  TAG: store_dir_select_algorithm #	Set this to 'round-robin' as an [email protected]@ -2400,12 +2407,16 @@ access_log /var/log/squid/access.log squid # #Default: # diskd_program /usr/lib/squid/diskd-daemon+diskd_program /usr/lib/squid/diskd-daemon+  #  TAG: unlinkd_program #	Specify the location of the executable for file deletion process. # #Default: # unlinkd_program /usr/lib/squid/unlinkd+unlinkd_program /usr/lib/squid/unlinkd+  #  TAG: pinger_program # Note: This option is only available if Squid is rebuilt with [email protected]@ -4884,6 +4895,7 @@ coredump_dir /var/spool/squid # #Default: # pipeline_prefetch off+pipeline_prefetch on  #  TAG: high_response_time_warning	(msec) #	If the one-minute median response time exceeds this value,

还有一个可以调节的参数就是detect_broken_pconn, 可以设置为on

 

一个可用的,最小的squid配置

http_access allow allhttp_port  10.243.240.10:8126cache_mem 0 MBaccess_log nonerefresh_pattern ^ftp:       1440    20% 10080refresh_pattern ^gopher:    1440    0%  1440refresh_pattern -i (/cgi-bin/|\\?) 0 0%  0refresh_pattern .       0   20% 4320via off

分类: 默认 标签: 发布于: 2012, 点击数: