手机版
你好,游客 登录 注册
背景:
阅读新闻

Squid2.7+iptables+透明代理+sarg

[日期:2012-06-24] 来源:Linux社区  作者:linux521 [字体:大 中 小]

补充:

1. Squidclient 的基本的使用方法

  1. squidclient -p 80 mgr:info      #取得squid运行状态信息:  
  2. squidclient -p 80 mgr:mem     #取得squid内存使用情况:  
  3. squidclient -p 80 mgr:objects. use it carefully,it may crash   #取得squid已经缓存的列表:  
  4. squidclient -p 80 mgr:diskd  #取得squid的磁盘使用情况:  
  5. squidclient -p 80 -m PURGE http://www.test.com/test.htlm  #强制更新某个url 

更多的请查看:squidclient -h 或者 squidclient -p 80 mgr: 

2.  如何得知 squid 执行中的状态?

还有一个容易的方法,就是使用 cachemgr.cgi 这个安装好 squid 后就有,只要在 apache 配置一下

要查看 Cache Manager 时,只要用下面的方法,就行了,我以后晚点介绍一下这个

http://IP/cgi-bin/cachemgr.cgi

当然,我更加喜欢命令使用下面的方法

  1. squidclient -t 1 -h localhost -p 80 mgr:inf #这样也行 

下面是一些基本内容

Squid Object Cache: Version 2.6 //Squid的版本

  1. HTTP/1.0 200 OK  
  2. Date: Tue, 11 Mar 2008 16:08:14 GMT  
  3. Content-Type: text/plain  
  4. Expires: Tue, 11 Mar 2008 16:08:14 GMT  
  5. Last-Modified: Tue, 11 Mar 2008 16:08:14 GMT  
  6. Connection: close  
  7.    
  8. Squid Object Cache: Version 2.6.STABLE6  
  9. Start Time:     Tue, 11 Mar 2008 10:21:47 GMT  
  10. Current Time:   Tue, 11 Mar 2008 16:08:14 GMT  
  11. Connection information for squid:  
  12.         Number of clients accessing cache:      2023            #使用proxy的电脑数量  
  13.         Number of HTTP requests received:       81787        #客户端http要求数量  
  14.         Number of ICP messages received:        0        #接受到的icp query数量  
  15.         Number of ICP messages sent:    0            #发出icp query数量  
  16.         Number of queued ICP replies:   0  
  17.         Request failure ratio:   0.00  
  18.         Average HTTP requests per minute since start:   236.1    #每分钟http request的数量  
  19.         Average ICP messages per minute since start:    0.0  
  20.         Select loop called: 24789642 times, 0.839 ms avg  
  21. Cache information for squid:  
  22.         Request Hit Ratios:     5min: 99.6%, 60min: 98.7%    #Cache Request命中率  
  23.         Byte Hit Ratios:        5min: 100.0%, 60min: 100.0%    #Cache Byte命中率  
  24.         Request Memory Hit Ratios:      5min: 1.6%, 60min: 1.2%  
  25.         Request Disk Hit Ratios:        5min: 82.0%, 60min: 90.5%  
  26.         Storage Swap size:      7723212 KB            #存放cache的硬盘使用  
  27.         Storage Mem size:       7992 KB               #存放cache的内存使用  
  28.         Mean Object Size:       264.01 KB              #平均的对象大小  
  29.         Requests given to unlinkd:      279  
  30. Median Service Times (seconds)  5 min    60 min:  
  31.         HTTP Requests (All):   2.94900  3.46762  
  32.         Cache Misses:          0.03427  0.03427  
  33.         Cache Hits:            5.06039  4.79440  
  34.         Near Hits:             0.30459  0.35832  
  35.         Not-Modified Replies:  0.00179  0.00179  
  36.         DNS Lookups:           0.00000  0.00000  
  37.         ICP Queries:           0.00000  0.00000  
  38. Resource usage for squid:  
  39.         UP Time:        20787.011 seconds  
  40.         CPU Time:       128.799 seconds  
  41.         CPU Usage:      0.62%  
  42.         CPU Usage, 5 minute avg:        0.44%  
  43.         CPU Usage, 60 minute avg:       0.51%  
  44.         Process Data Segment Size via sbrk(): 34292 KB  
  45.         Maximum Resident Size: 0 KB  
  46.         Page faults with physical i/o: 0  
  47. Memory usage for squid via mallinfo():  
  48.         Total space in arena:   34424 KB  
  49.         Ordinary blocks:        27031 KB   8599 blks  
  50.         Small blocks:               0 KB      0 blks  
  51.         Holding blocks:          6152 KB      2 blks  
  52.         Free Small blocks:          0 KB  
  53.         Free Ordinary blocks:    7392 KB  
  54.         Total in use:           33183 KB 82%  
  55.         Total free:              7392 KB 18%  
  56.         Total size:             40576 KB  
  57. Memory accounted for:               #内存使用状态  
  58.         Total accounted:        21777 KB  
  59.         memPoolAlloc calls: 15446992  
  60.         memPoolFree calls: 15337015  
  61. File descriptor usage for squid:  
  62.         Maximum number of file descriptors:   16384        系统最大file descriptor数  
  63.         Largest file desc currently in use:   1165        目前使用file descriptor最大值  
  64.         Number of file desc currently in use:  571        目前正在使用的file descriptor数  
  65.         Files queued for open:                   0  
  66.         Available number of file descriptors: 15813  
  67.         Reserved number of file descriptors:   100  
  68.         Store Disk files open:                 266  
  69.         IO loop method:                     epoll  
  70. Internal Data Structures:  
  71.          29315 StoreEntries            #Cache中存放的 object 的数量  
  72.            190 StoreEntries with MemObjects    #内存中 object 数量  
  73.            176 Hot Object Cache Items        #热点的 object 的数量  
  74.          29253 on-disk objects              # 不在硬盘上的 object 的数量 
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款