4323e 发表于 2015-1-13 08:56:18

提高squid缓存的命中率

安装运行squid后用命令squidclient -t 1 -h localhost -p 80 mgr:info 查看命中率情况
Request Hit Ratios:   5min: 99.6%, 60min: 98.7%    Cache Request命中率 Byte Hit Ratios:      5min: 100.0%, 60min: 100.0%    Cache Byte命中率
如果命中率低 则1apache中的模块 mod_expires是否打开
2调整squid中的参数# cache_mem 8 MBcache_mem 64 MB# maximum_object_size 4096 KBmaximum_object_size 16384 KB# maximum_object_size_in_memory 8 KBmaximum_object_size_in_memory 256 KB# ipcache_size 1024ipcache_size 2048#Default:cache_dir ufs /usr/local/squid/cache 2048 32 5123如果apache中使用了deflate压缩   设置   cache_vary on4 如果用nginx 可以用第三方模块mod_urlhash 提高命中率
页: [1]
查看完整版本: 提高squid缓存的命中率