- 论坛徽章:
- 0
|
我的配置文件 里面不少东西网上都有介绍,你可以搜一下,其实还有一个地方可以优化,不过我太懒了,懒得重新编译,所以就算了,你看前面部分就好了,规则那里不用看了,不过最后一条最好加上,否则上hotmail不好用,不知道是不是我走2级代理的问题,直接走可能不需要吧
http_port 172.16.6.8:1201
visible_hostname MXMGY
cache_mgr mxmgy
error_directory /usr/local/etc/squid/errors/Simplify_Chinese/
dns_nameservers 202.118.224.101
cache_swap_low 80
cache_swap_high 95
half_closed_clients off
cache_mem 64 MB
maximum_object_size 5120 KB
maximum_object_size_in_memory 256 KB
memory_replacement_policy heap LRU
cache_replacement_policy heap LFUDA
cache_dir ufs /usr/local/squid/cache 1024 16 256
refresh_pattern -i .html 1440 90% 129600 reload-into-ims
refresh_pattern -i .shtml 1440 90% 129600 reload-into-ims
refresh_pattern -i .hml 1440 90% 129600 reload-into-ims
refresh_pattern -i .gif 1440 90% 129600 reload-into-ims
refresh_pattern -i .swf 1440 90% 129600 reload-into-ims
refresh_pattern -i .jpg 1440 90% 129600 reload-into-ims
refresh_pattern -i .png 1440 90% 129600 reload-into-ims
refresh_pattern -i .bmp 1440 90% 129600 reload-into-ims
refresh_pattern -i .js 1440 90% 129600 reload-into-ims
#cache_dir null /tmp
connect_timeout 60 seconds
read_timeout 3 minutes
request_timeout 30 seconds
client_lifetime 10 minutes
cache_access_log /usr/local/squid/logs/access.log
cache_store_log none
logfile_rotate 1
pid_filename /usr/local/squid/logs/squid.pid
acl all src 0.0.0.0
acl freeip dst "/etc/freeip"
acl HIT dstdomain .hit.edu.cn
acl Safe_ports port 80 # http
acl Safe_ports port 443 563 # https, snews
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
cache_peer 210.46.69.10 parent 8080 0 no-query
acl conncount maxconn 100
http_access deny conncount all
http_access deny HIT
http_access deny !Safe_ports
http_access allow all
always_direct allow freeip
nonhierarchical_direct off
另外你最好重新编译下内核,加入下面这几行 关于polling你可以查一下相关说明,貌似在大负载下效果比较明显,我这里没有那环境,不过带200多个ip,cpu很少超过20%,pII 400 的u
options AUTO_EOI_1
makeoptions CONF_CFLAGS=-fno-builtin
options ZERO_COPY_SOCKETS
options DEVICE_POLLING
options HZ=1000
options MAXDSIZ=(512UL*1024*1024) 这一部分根据你的内存调整一下
options MAXSSIZ=(512UL*1024*1024)
options DFLDSIZ=(512UL*1024*1024)
options MSGMNB=16384 # max # of bytes in a queue
options MSGMNI=41 # number of message queue identifiers
options MSGSEG=2049 # number of message segments per queue
options MSGSSZ=64 # size of a message segment
options MSGTQL=2048 # max messages in system
options SHMSEG=32 # max shared mem id's per process
options SHMMNI=64 # max shared mem id's per system
options SHMMAX=4194304 # max shared memory segment size (bytes)
options SHMALL=8192 # max amount of shared memory (pages) |
|