设为首页 收藏本站
查看: 990|回复: 0

[经验分享] 针对同一个静态页面,squid、varnish、trafficserver性能以及命中率的比较

[复制链接]

尚未签到

发表于 2018-12-27 13:36:48 | 显示全部楼层 |阅读模式
  注:以下测试是在自己组装机器内进行
  [root@www varnish]# cat /proc/cpuinfo  #cpu信息一个
  processor       : 0
  vendor_id       : GenuineIntel
  cpu family      : 6
  model           : 58
  model name      : Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
  stepping        : 9
  cpu MHz         : 1600.000
  cache size      : 3072 KB
  physical id     : 0
  siblings        : 4
  core id         : 0
  cpu cores       : 2
  apicid          : 0
  initial apicid  : 0
  fpu             : yes
  fpu_exception   : yes
  cpuid level     : 13
  wp              : yes
  flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt xsave avx f16c lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
  bogomips        : 6584.86
  clflush size    : 64
  cache_alignment : 64
  address sizes   : 36 bits physical, 48 bits virtual
  [root@www varnish]# cat /proc/version  #内核信息
  Linux version 2.6.32-220.el6.x86_64
  [root@www varnish]# lsb_release -a    #操作系统信息
  LSB Version:    :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
  Distributor ID: CentOS
  Description:    CentOS release 6.2 (Final)
  Release:        6.2
  Codename:       Final
  

  [root@www varnish]# cat /proc/meminfo   #内存情况,共8G
  MemTotal:        7736292 kB
  MemFree:         4841624 kB
  Buffers:          294216 kB
  Cached:          2132408 kB
  SwapCached:            0 kB
  Active:          1340076 kB
  

  测试详细结果:
  [root@localhost ~]# webbench -c 500 -t 60 http://www.bbs.linuxblind.com/index.html
  Webbench - Simple Web Benchmark 1.5
  Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
  

  Benchmarking: GET http://www.bbs.linuxblind.com/index.html
  500 clients, running 60 sec.
  

  Speed=495622 pages/min, 2788085 bytes/sec.
  Requests: 495167 susceed, 455 failed.
  -----------------------------------------------------------------------------------------
  [root@localhost ~]# /usr/local/squid/bin/squidclient -h 192.168.1.108 -p 80 mgr:info
  HTTP/1.1 200 OK
  Server: squid/3.3.8
  Mime-Version: 1.0
  Date: Wed, 21 Aug 2013 08:28:44 GMT
  Content-Type: text/plain
  Expires: Wed, 21 Aug 2013 08:28:44 GMT
  Last-Modified: Wed, 21 Aug 2013 08:28:44 GMT
  X-Cache: MISS from linuxblind
  X-Cache-Lookup: MISS from linuxblind:80
  Via: 1.1 linuxblind (squid/3.3.8)
  Connection: close
  

  Squid Object Cache: Version 3.3.8
  Start Time:     Wed, 21 Aug 2013 08:25:16 GMT
  Current Time:   Wed, 21 Aug 2013 08:28:44 GMT
  Connection information for squid:
  Number of clients accessing cache:      2
  Number of HTTP requests received:       495341
  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:   142850.5
  Average ICP messages per minute since start:    0.0
  Select loop called: 610212 times, 0.341 ms avg
  Cache information for squid:
  Hits as % of all requests:      5min: 100.0%, 60min: 100.0%
          Hits as % of bytes sent:        5min: 100.0%, 60min: 100.0%
  Memory hits as % of hit requests:       5min: 100.0%, 60min: 100.0%
  Disk hits as % of hit requests: 5min: 0.0%, 60min: 0.0%
  Storage Swap size:      4220 KB
  Storage Swap capacity:   0.4% used, 99.6% free
  Storage Mem size:       224 KB
  Storage Mem capacity:    0.1% used, 99.9% free
  Mean Object Size:       26.38 KB
  Requests given to unlinkd:      0
  Median Service Times (seconds)  5 min    60 min:
  HTTP Requests (All):   0.00000  0.00000
  Cache Misses:          0.00000  0.00000
  Cache Hits:            0.00000  0.00000
  Near Hits:             0.00000  0.00000
  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:        208.053 seconds
  CPU Time:       60.177 seconds
  CPU Usage:      28.92%
  CPU Usage, 5 minute avg:        33.42%
  CPU Usage, 60 minute avg:       33.42%
  Process Data Segment Size via sbrk(): 4492 KB
  Maximum Resident Size: 50624 KB
  Page faults with physical i/o: 0
  Memory usage for squid via mallinfo():
  Total space in arena:    4624 KB
  Ordinary blocks:         4500 KB    179 blks
  Small blocks:               0 KB      0 blks
  Holding blocks:         10916 KB      5 blks
  Free Small blocks:          0 KB
  Free Ordinary blocks:     124 KB
  Total in use:             124 KB 1%
  Total free:               124 KB 1%
  Total size:             15540 KB
  Memory accounted for:
  Total accounted:          942 KB   6%
  memPool accounted:        942 KB   6%
  memPool unaccounted:    14598 KB  94%
  memPoolAlloc calls:  40123090
  memPoolFree calls:   40124835
  File descriptor usage for squid:
  Maximum number of file descriptors:   20480
  Largest file desc currently in use:     60
  Number of file desc currently in use:   26
  Files queued for open:                   0
  Available number of file descriptors: 20454
  Reserved number of file descriptors:   100
  Store Disk files open:                   0
  Internal Data Structures:
  213 StoreEntries
  54 StoreEntries with MemObjects
  53 Hot Object Cache Items
  160 on-disk objects
  

  -----------------------------------------------------------------------------------------
  [root@www ats]# webbench -c 500 -t 60 http://www.bbs.linuxblind.com/index.html
  Webbench - Simple Web Benchmark 1.5
  Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
  

  Benchmarking: GET http://www.bbs.linuxblind.com/index.html
  500 clients, running 60 sec.
  

  Speed=1604781 pages/min, 8554361 bytes/sec.
  Requests: 1604781 susceed, 0 failed.
  ---------------------------------------------------------------------------------------
  [root@www ats]# echo "show:cache-stats" |traffic_shell  
  Successfully Initialized MgmtAPI in /usr/local/ats/var/trafficserver
  trafficserver> show:cache-stats
  

  Bytes Used --- 0 GB
  Cache Size --- 599 GB
  --RAM Cache--
  Total Bytes -- 2147483648
  Bytes Used --- 16384
  Hits --------- 1604521
  Misses ------- 4
  --Lookups--
  In Progress -- 0
  Hits --------- 0
  Misses ------- 0
  --Reads--
  In Progress -- 0
  Hits --------- 1604524
  Misses ------- 751
  --Writes--
  In Progress -- 0
  Hits --------- 4
  Misses ------- 747
  --Updates--
  In Progress -- 0
  Hits --------- 0
  Misses ------- 0
  --Removes--
  In Progress -- 0
  Hits --------- 0
  Misses ------- 0
  

  -----------------------------------------------------------------------------------------
  [root@www varnish]# webbench -c 500 -t 60 http://www.bbs.linuxblind.com/index.html
  Webbench - Simple Web Benchmark 1.5
  Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
  

  Benchmarking: GET http://www.bbs.linuxblind.com/index.html
  500 clients, running 60 sec.
  

  Speed=1498734 pages/min, 8988399 bytes/sec.
  Requests: 1498725 susceed, 9 failed.
  ---------------------------------------------------------------------------------------
  [root@www vcache]# /usr/local/varnish/bin/varnishstat  -n /var/vcache
  

  0+00:04:26                                                                                                   /var/vcache
  Hitrate ratio:       10       61       61
  Hitrate avg:     1.0000   1.0000   1.0000
  

  1498607         0.00      5633.86 client_conn - Client connections accepted
       1498855         0.00      5634.79 client_req - Client requests received
       1498854         0.00      5634.79 cache_hit - Cache hits
   1         0.00         0.00 cache_miss - Cache misses
  1         0.00         0.00 backend_conn - Backend conn. success
  1         0.00         0.00 backend_recycle - Backend conn. recycles
  1         0.00         0.00 fetch_length - Fetch with Length
  299          .            .   n_sess_mem - N struct sess_mem
  0          .            .   n_sess - N struct sess
  1          .            .   n_object - N struct object
  113          .            .   n_objectcore - N struct objectcore
  113          .            .   n_objecthead - N struct objecthead
  112          .            .   n_waitinglist - N struct waitinglist
  1          .            .   n_vbc - N struct vbc
  113          .            .   n_wrk - N worker threads
  113         0.00         0.42 n_wrk_create - N worker threads created
  1130         0.00         4.25 n_wrk_queued - N queued work requests
  1          .            .   n_backend - N backends
  30          .            .   n_lru_moved - N LRU moved objects
  1475441         0.00      5546.77 n_objwrite - Objects sent with write
  1498860         0.00      5634.81 s_sess - Total Sessions
  1498855         0.00      5634.79 s_req - Total Requests
  1         0.00         0.00 s_fetch - Total fetch
  519864531         0.00   1954377.94 s_hdrbytes - Total header bytes
  19485115         0.00     73252.31 s_bodybytes - Total body bytes

  通过上图可以看出:
  单位时间内,squid、varnish、ats性能呈现递增趋势,然而命中率却呈现出了下降趋势。
  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-656528-1-1.html 上篇帖子: squid缓存服务的搭建和配置管理 下篇帖子: Linux系统下Squid服务器配置详解【一】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表