image.png
主要是内存和磁盘
image.png
安装SQUID前一定要调整文件描述符
echo fs.file-max=792956 >> /etc/sysctl.conf
sysctl -p
echo * soft nofile 792956 >> /etc/security/limits.conf
echo * hard nofile 792956 >> /etc/security/limits.conf
调整临时端口
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
/etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65535
sysctl -p
//.configure编译机制
--enable-dlmalloc 使用另外的内存分配机制
--enable-carp
--enable-async-io 异步IO
--enable-removal-policies 缓存排除策略LRU,GDS,LFU
squid打补丁
squid.conf 配置语法,大小写敏感
image.png
image.png
cache_effective_user
image.png
端口号设置 http_port
image.png
cache.log access.log store.log
image.png
访问控制 acl he src 192.168.1.1/24 http_access allow/deny he
image.png
启动参数
image.png
image.png
-k parse
image.png
-z
调试
启动 /usr/local/squid/bin/squid -sD squid -k shutdown #关闭 squid -k reconfigure #重新加载配置文件 squid -k rotate #滚动日志
acl xx port 1 2 3 acl xx src xx xx ACL资源: IP:src dst myip 172.16.10.0-172.16.19.0/24 dstdomain域名匹配规则
image.png
image.png
用户名匹配,为严格匹配 ident proxy_auth 正则匹配
image.png
image.png
端口匹配 port
image.png
自主:src_as
myip用于内部
image.png
image.png
image.png
myport 指向自己
image.png
method方法控制 acl uploads method PUT POST GET HEAD CONNECT TRACE OPTIONS DELETE 只允许443 563端口的连接
image.png
PURGE只允许本机删除缓存
image.png
proto控制 http https ftp gopher urn whois cache_object 管理proto
image.png
time S sunday M monday T tuesday H thursday F friday A saturday D all acl xx D 08:00-17:00
image.png
image.png
ident?? proxy_auth
image.png
maxconn每个用户可以多少连接
image.png
根据MAC地址来
image.png
正则表达式
image.png
image.png
image.png
image.png
根据browser
image.png
req_mime_type 请求的文件类型
image.png
文件
image.png
访问控制规则 http_access no_cache miss_access redirector_access deny_access
http_access allow/deny ! allow x y z
cache_dir ufs xx
image.png
建议每个磁盘只一个cache
image.png
image.png
??
image.png
maximum_object_size 100M
image.png
lease-load round-robin
image.png
cache_replacement_policy RLU
image.png
image.png
image.png
删除缓存对象
image.png
删除个别对象purge
image.png
删除整个磁盘上缓存
image.png
refresh_pattern???
image.png
使用squid的不要用raid 优化squid noatime async
image.png
内核参数修改
image.png
image.png
--
磁盘存储机制的选择????
HTTP拦截:
cache拦截:https://blog.csdn.net/chinalinuxzend/article/details/1784462?utm_source=blogxgwz7
--
与邻居的关系
cache_peer_access 禁止循环转发
image.png
cache_peer设置与邻居的关系
image.png
image.png
??
image.png
image.png
image.png
FTP给A,HTTP给B
image.png
时间控制
image.png
根据域名来
image.png
never_direct 绝不请求后端服务器 always_direct 绝不缓存
image.png
??
image.png
netdb 网络度量数据库
ICP
image.png
image.png
HTCP?
CARP?
重定向 redirect_program
image.png
redirect_children 20 redirect_rewrites_host_header
image.png
image.png
验证辅助器 auth_param验证方式
image.png
image.png
NCSA
image.png
日志文件 cache.log 配置信息、性能警告、错误 access.log 分析工具 calamaris webalyzer store.log swap.state 缓存写到磁盘的日志 日志轮询: suiqd -k rotate
image.png
服务器加速
httpd_accel_host
httpd_accel_port
image.png
服务加速:https://blog.csdn.net/chinalinuxzend/article/details/1784470