root@localhost squid]# squidclient -p 80 mgr:info
HTTP/1.0 200 OK
Server: squid/3.1.10
Mime-Version: 1.0
Date: Mon, 26 Nov 2012 14:41:51 GMT
Content-Type: text/plain
Expires: Mon, 26 Nov 2012 14:41:51 GMT
Last-Modified: Mon, 26 Nov 2012 14:41:51 GMT
X-Cache: MISS from cache.361way.com
X-Cache-Lookup: MISS from cache.361way.com:80
Via: 1.0 cache.361way.com (squid/3.1.10)
Connection: close
Squid Object Cache: Version 3.1.10
Start Time:     Mon, 26 Nov 2012 13:18:50 GMT
Current Time:   Mon, 26 Nov 2012 14:41:51 GMT
Connection information for squid:
        Number of clients accessing cache:      34
        Number of HTTP requests received:       774
        Number of ICP messages received:        0
        Number of ICP messages sent:    0
        Number of queued ICP replies:   0
        Number of HTCP messages received:       0
        Number of HTCP messages sent:   0
        Request failure ratio:   0.00
        Average HTTP requests per minute since start:   9.3   #每分钟http request的数量
        Average ICP messages per minute since start:    0.0
        Select loop called: 637052 times, 7.818 ms avg
Cache information for squid:
        Hits as % of all requests:      5min: 77.1%, 60min: 58.8%   #Cache Request命中率
        Hits as % of bytes sent:        5min: 28.4%, 60min: 20.4%   #Cache Byte命中率
        Memory hits as % of hit requests:       5min: 43.9%, 60min: 32.0%
        Disk hits as % of hit requests: 5min: 0.0%, 60min: 0.2%
        Storage Swap size:      328 KB  #存放cache的硬盘使用大小
        Storage Swap capacity:   0.0% used, 100.0% free
        Storage Mem size:       436 KB   #存放cache的内存使用大小
        Storage Mem capacity:    0.1% used, 99.9% free
        Mean Object Size:       6.56 KB
        Requests given to unlinkd:      2
Median Service Times (seconds)  5 min    60 min:
        HTTP Requests (All):   0.06286  0.06286
        Cache Misses:          0.32154  0.20843
        Cache Hits:            0.00000  0.00000
        Near Hits:             0.06286  0.06286
        Not-Modified Replies:  0.00000  0.00000
        DNS Lookups:           0.00000  0.00000
        ICP Queries:           0.00000  0.00000
Resource usage for squid:
        UP Time:        4980.301 seconds
        CPU Time:       1.379 seconds
        CPU Usage:0.03%
        CPU Usage,5 minute avg:0.09%
        CPU Usage,60 minute avg:0.03%ProcessDataSegmentSize via sbrk():7508 KB
        MaximumResidentSize:59728 KB
        Page faults with physical i/o:0Memory usage for squid via mallinfo():Total space in arena:7640 KB
        Ordinary blocks:7587 KB     61 blks
        Small blocks:0 KB      0 blks
        Holding blocks:1228 KB      5 blks
        FreeSmall blocks:0 KB
        FreeOrdinary blocks:52 KB
        Totalinuse:8815 KB 99%Total free:52 KB 1%Total size:8868 KB
Memory accounted for:#内存使用情况Total accounted:1253 KB  14%
        memPool accounted:1253 KB  14%
        memPool unaccounted:7614 KB  86%
        memPoolAlloc calls:167272
        memPoolFree calls:169189File descriptor usage for squid:Maximum number of file descriptors:1024#系统最大file descriptor数Largest file desc currently inuse:39#目前使用file descriptor最大值Number of file desc currently inuse:33#目前正在使用的file descriptor数Files queued for open:0Available number of file descriptors:991Reserved number of file descriptors:100StoreDisk files open:0InternalDataStructures:77StoreEntries#Cache中存放的 object 的数量77StoreEntrieswithMemObjects#内存中 object 数量76HotObjectCacheItems#热点object 的数量50 on-disk objects # 硬盘上的object的数量

上面的-p后面根的是端口,根据自己具体的情况而定。如果是3128端口,就把上面的80换成3128就行了。另外一些常用的squidclient查询语句如下:

squidclient -p 80 mgr:info      #取得squid运行状态信息:
squidclient -p 80 mgr:mem     #取得squid内存使用情况:
squidclient -p 80 mgr:objects #取得squid已经缓存的列表,使用时要小心,可能会造成squid崩溃:
squidclient -p 80 mgr:diskd  #取得squid的磁盘使用情况:
squidclient -p 80 -m PURGE http://www.361way.com  #强制更新某个url,即清理某连接的squid




posted on 2015-09-11 15:19  FEX-x  阅读(367)  评论(0编辑  收藏  举报