我还在学习鱿鱼而且不明白这是怎么回事。现在我有一台服务器,当我从服务器ping一个网站时,我可以获得1ms的平均ping时间。但是,在使用Squid制作一些代理并通过同一服务器上的代理(使用代理测试应用程序)测试同一网站后,最低ping时间是98ms(在我更改dns服务器后,最低下降到94ms) 。那么是什么造成了巨大的差异,从1ms到90 + ms?有没有办法优化代理?我在同一台服务器上运行squid代理服务器和应用程序。任何帮助或输入将不胜感激!!
#
# Recommended minimum configuration:
#
auth_param basic program /cygdrive/c/squid/lib/squid/basic_ncsa_auth /cygdrive/c/squid/etc/squid/pwfile
auth_param basic children 10
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
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
acl auth_users proxy_auth REQUIRED
acl authip src 1.1.1.1
http_access allow authip
# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager
http_access allow auth_users
# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# And finally deny all other access to this proxy
http_access deny all
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost
acl ip1 myip 1.1.1.1
tcp_outgoing_address 1.1.1.1 ip1
tcp_outgoing_address 0.0.0.0 all
http_access allow ip1
# Squid normally listens to port 3128
http_port 2424
# Uncomment the line below to enable disk caching - path format is /cygdrive/<full path to cache folder>, i.e.
cache_dir awin32 d:/squidcachedir/cache 10000 16 256
# memory_cache_mode always
maximum_object_size_in_memory 102400 KB
half_closed_clients off
cache_mem 256 MB
memory_pools off
# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid
# Add any of your own refresh_pattern entries above these.
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
# cache_peer 23.0.13.5 parent 3128 3130 default no-query
ipcache_size 10240
negative_dns_ttl 5 minutes
positive_dns_ttl 6 hours
dns_nameservers 129.250.35.250 74.82.42.42 208.67.222.222
cache_replacement_policy heap
cache_swap_low 90
cache_swap_high 95
quick_abort_min 0 KB
quick_abort_max 0 KB
log_icp_queries off
client_db off
buffered_logs on
half_closed_clients off
max_filedescriptors 3200
dns_v4_first on
forwarded_for delete
request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all