免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: myfreeke
打印 上一主题 下一主题

[proxy] varnish 2.0 vcl 请教 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2008-12-22 14:40 |只看该作者
我在2.02版本下模拟三万客户端并发测试,发现我的一个四核CPU占用 375%

系统load 32

0+00:17:13                                                                                                 /var/InfiNET/cache
Hitrate ratio:        9        9        9
Hitrate avg:     0.8388   0.8388   0.8388

      136041         0.00       131.70 Client connections accepted
      135733         0.00       131.40 Client requests received
      135695         0.00       131.36 Cache hits
           0         0.00         0.00 Cache hits for pass
          58         0.00         0.06 Cache misses
          58         0.00         0.06 Backend connections success
           0         0.00         0.00 Backend connections failures
           0         0.00         0.00 Backend connections reuses
           0         0.00         0.00 Backend connections recycles
           0         0.00         0.00 Backend connections unused
           3          .            .   N struct srcaddr
           0          .            .   N active struct srcaddr
        4121          .            .   N struct sess_mem
          80          .            .   N struct sess
         328          .            .   N struct object
         328          .            .   N struct objecthead
         387          .            .   N struct smf
           0          .            .   N small free smf
           1          .            .   N large free smf
           0          .            .   N struct vbe_conn
           2          .            .   N struct bereq
           0          .            .   N worker threads
         271         0.00         0.26 N worker threads created
           5         0.00         0.00 N worker threads not created
           0         0.00         0.00 N worker threads limited
           0         0.00         0.00 N queued work requests
           0         0.00         0.00 N overflowed work requests
           0         0.00         0.00 N dropped work requests
           3          .            .   N backends
           0          .            .   N expired objects
           0          .            .   N LRU nuked objects
           0          .            .   N LRU saved objects
          76          .            .   N LRU moved objects
           0          .            .   N objects on deathrow
           0         0.00         0.00 HTTP header overflows
           0         0.00         0.00 Objects sent with sendfile
      135520         0.00       131.19 Objects sent with write
           0         0.00         0.00 Objects overflowing workspace
      136041         0.00       131.70 Total Sessions
      135767         0.00       131.43 Total Requests

论坛徽章:
0
12 [报告]
发表于 2009-03-02 10:43 |只看该作者

是你的启动文件造成的

如果你的配置文件是按varnish 2.0的语法写的,没有问题的话,慢的原因都是你的启动文件造成的,这个问题有N多人提到了,尤其是一开始用varnish1的人升到2.0遇到的情况,还有使用参考了张宴的文章来配置2.0时会出现这个情况。
参考下面的启动文件方式   很多人用我这个方法都解决了。

Var_Path=/usr/local/varnish/sbin                                                   
Var_File=/usr/local/varnish/vcl.conf                                               
echo $Var_File                                                                     
date -u                                                                           
ulimit -HSn 65000                                                                  
$Var_Path/varnishd \
-n /var/vcache \
-a 0.0.0.0:80 \
-s file,/var/vcache/varnish_cache.data,15G \
-g nobody -u nobody \
-T 127.0.0.1:3500 \
-f $Var_File \
-p thread_pool_max=2048 \
-p thread_pools=4 \
-p client_http11=on \
-p backend_http11=on


www.OhLinux.com

论坛徽章:
0
13 [报告]
发表于 2009-03-02 13:32 |只看该作者
呵呵,感谢回复,这个问题在上个月就已经了解原因了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP