[CDN 技术] squid 中使用 cachemgr 来 Web 查看相关详细信息
转载本站文章请注明,转载自:扶凯[http://www.php-oa.com]
本文链接: http://www.php-oa.com/2010/05/06/squid-cachemgr-web.html
我在二年前介绍过强大的 squidclient .强大到连配置文件,都可以用这个命令来找出来.不得不讲 Squid 是 Cache 软件中设计最优秀的.原来的文章在这
http://www.php-oa.com/2008/03/11/squid-squidclient.html
我还提到过一个叫 cachemgr.cgi 的程序,可以 Web 来显示内容,但一直讲要写出来,但一直没有做这事,这个对于调整 squid 的参数很是方便.可以直接在 Web 见到相关的信息.
平时我们安装完 squid 后其实就有这个程序了.我们只要在 Apache 中配置一下就行了.
1. 配置 Apache 中的 squid.加入 cachemgr.cgi 来显示
ScriptAlias "/squid" "/usr/libexec/squid/cachemgr.cgi" <Location "/squid"> Order deny,allow Deny from all Allow from all </location>
2. 直接打开测试就行了.默认好象是不用密码和用户的,记的端口要写对
可以显示的内容如下
Memory Utilization
Callback Data Registry Contents
Event Queue
Async IO Function Counters
COSS Stats
DISKD Stats
Current Squid Configuration (hidden).
IP Cache Stats and Contents
FQDN Cache Stats and Contents
Internal DNS Statistics
External ACL stats
HTTP Header Statistics
Via Request Headers
X-Forwarded-For Request Headers
This Cachemanager Menu
Shut Down the Squid Process (hidden).
Reconfigure the Squid Process (hidden).
Toggle offline_mode setting (hidden).
General Runtime Information
Process Filedescriptor Allocation
All Cache Objects
In-Memory and In-Transit Objects
Objects with Swapout files open
Objects being retreived from the network
Objects being sent to clients
Server-side network read() size histograms
Traffic and Resource Counters
Peer Selection Algorithms
Cache Digest and ICP blob
5 Minute Average of Counters
60 Minute Average of Counters
Cache Utilization
Full Histogram Counts
Client-side Active Requests
Store Digest
Store Directory Stats
storeCheckCachable() Stats
Store IO Interface Stats
如图
内容显示如下
附:如果使用 squidclinet 来查看本地的信息.有些信息是需要用户密码的,这个需要在 squid.conf 中配置
cachemgr_passwd testpass config # 第一个参数是密码,第二个是内容,可以加多个内容 cache_mgr support@php-oa.com
使用的时候加上用户密码就行了
squidclient -p 80 -U support@php-oa.com -W testpass mgr:config


















