- 论坛徽章:
- 0
|
1、当前用的squid版本是squid-3.0.STABLE24.tar.gz
2、编译参数: ./configure --prefix=/usr/local/squid3 --enable-storeio=aufs,diskd,ufs --enable-linux-tproxy --enable-linux-netfilter
3、应用环境:公司做的透明代理
参数配置:
==================================
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16
acl localnet src 116.236.255.222/32 # MT IPAddress
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access deny all
icp_access allow localnet
icp_access deny all
htcp_access allow localnet
htcp_access deny all
http_port 192.168.0.20:3128 transparent
http_port 127.0.0.1:3128
dead_peer_timeout 10 seconds
hierarchy_stoplist cgi-bin ?
cache_mem 768 MB
cache_dir aufs /cache1 5120 16 256
cache_dir aufs /cache2 5120 16 256
maximum_object_size 4096 KB
cache_swap_low 85
cache_swap_high 90
logformat squid %tl.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log none
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
forward_timeout 4 minutes
connect_timeout 1 minute
peer_connect_timeout 30 seconds
request_timeout 5 minutes
persistent_request_timeout 2 minutes
ident_timeout 10 seconds
cache_effective_user squid
cache_effective_group squid
visible_hostname linkinfor
icp_port 0
maximum_icp_query_timeout 200
coredump_dir /cache1/
reply_header_access Server deny all
reply_header_access X-Cache deny all
reply_header_access Warning deny all
reply_header_access Expires deny all
reply_header_access Cache-Control deny all
reply_header_access age deny all
connect_timeout 1 minute
negative_ttl 0 minutes
read_timeout 30 seconds
pconn_timeout 120 seconds
shutdown_lifetime 5 seconds
strip_query_terms off
=========================
出现问题:
File descriptor usage for squid:
Maximum number of file descriptors: 1024
Largest file desc currently in use: 204
Number of file desc currently in use: 28
Files queued for open: 0
Available number of file descriptors: 996
Reserved number of file descriptors: 100
Store Disk files open: 3
Store Disk files open:中打开的文件一直不能释放。
这个从/proc/squid_pid/fd/下面看到。
lrwx------ 1 squid squid 64 Mar 4 15:38 25 -> /cache2/00/55/000055DD (deleted)
lrwx------ 1 squid squid 64 Mar 4 15:38 3 -> /var/log/squid/cache.log
lrwx------ 1 squid squid 64 Mar 4 15:38 5 -> /var/log/squid/cache.log
lrwx------ 1 squid squid 64 Mar 4 15:45 64 -> /cache1/00/42/0000422D
lrwx------ 1 squid squid 64 Mar 4 15:38 81 -> /cache2/00/3E/00003E43
其中deleted的是被删除掉的。64这个文件描述符是昨天打开的,现在还没有被释放。
这台机器因为人数少。根本不存在性能上的不足。 |
|