squid 版本squid-2.7.STABLE9
系统:centos5.5 64位
编译选项如下:
./configure --prefix=/a8root/bin/squid2.7/ --with-pthreads --enable-forward-log --enable-follow-x-forwarded-for --enable-dlmalloc --enable-xmalloc-statistics --enable-large-cache-files --with-large-files --enable-epoll --enable-snmp --with-maxfd=65535 --enable-removal-policies=heap,lru --libdir=/usr/lib64 --includedir=/usr/include -enable-cache-digests --enable-cachemgr-hostname --enable-icmp --enable-storeio=aufs,ufs,diskd,coss --enable-async-io=40
make
make install
make install-pinger
部分配置如下:
cache_swap_low 90
cache_swap_high 95
cache_mem 10240 MB
maximum_object_size 20000 KB
maximum_object_size_in_memory 4096 KB
minimum_object_size 0 KB
range_offset_limit -1 KB
quick_abort_min 50 KB
quick_abort_max 100 KB
quick_abort_pct 75
refresh_pattern -i .aac 86400 90% 129600 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-private
故障:
运行一段时间,squid自动重启,查看日志报错FATAL: xcalloc: Unable to allocate 1 blocks of 4112 bytes!
原因:编译打开了-enable-dlmalloc这个参数
意思是dlmalloc是squid在某些系统本身malloc太烂的情况的代替方案,dlmalloc已经很老,且不支持2G以上内存。
编译时候一定要把--enable-dlmalloc 去掉。
=======================================================
安装 tcmalloc
./configure --prefix=/a8root/bin/squid2.7/ --with-pthreads --enable-forward-log --enable-follow-x-forwarded-for --enable-xmalloc-statistics --enable-large-cache-files --with-large-files --enable-epoll --enable-snmp --with-maxfd=65535 --enable-removal-policies=heap,lru --libdir=/usr/lib64 --includedir=/usr/include -enable-cache-digests --enable-cachemgr-hostname --enable-icmp --enable-storeio=aufs,ufs,diskd,coss --enable-async-io=320
1,安装tcmalloc所需的libunwind库[32位系统无须安装]
先别make ,修改 src/Makefile ,搜索,在 squid _ LDADD后面加上 -ltcmalloc ,在 LDADD 后面也加上 -ltcmalloc:
vi src/Makefile
squid_LDADD = \
-L../lib \
-ltcmalloc \ /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig
4,squid使用tcmalloc的方法
公司要在分析access_log 日志,但怎么样也见不到?后面的url 的内容查了很多资料,最后发现.squid的access_log缺省是不记url里”?”后面的内容的原来在squid .conf里有个叫”strip_query_terms“的参数 ,缺省是打开的(ON) 设成off即可 squid文档里是这么写的:BSD爱好者乐园j-n ixOt%r9T)E/`2g
Tag Name strip_qury_terms
)@)oB#h?ls3mUsage strip_query_terms on|offBSD爱好者乐园0{ P4O-zw;S:z U+k
BSD爱好者乐园&\_,R Z.Q8s
Description Squid by default does not log query parameters. These parameters are however forwarded to the server verbatim. If we want to enable logging of query parameters, the strip_query_terms directive can be used . By default, Squid strips query terms from requested URLs before logging. This protects your user’s privacy
BpY2~-}rDefault strip_query_terms on
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com