What Kevin is Thinking

System Administration, System Optimizing and a little Programming :)
    <<  Squid3.0与2.7的配置差异 | 首 页 | 在CentOS5.2上搭建DNS服务器  >>
  • Varnish自动重启子进程问题更新 - [技术笔记]

    2009-04-16

    分类: 技术笔记

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://iyubo.blogbus.com/logs/37961366.html

    我的Varnish服务器在访问量达到一定程度的时候会出现自动重启子进程的问题,从日志中出现重启子进程时有以下错误提示

    Panic message: Missing errorhandling code in sma_alloc(), storage_malloc.c line 79:   Condition((sma->s.p
    tr) != 0) not true.  errno = 12 (Cannot allocate memory)  thread = (cache-worker)sp = 0x71a42004 {   fd = 4218, id = 4218, xid = 2057707839,   client = 116.3
    0.99.238:12844,   step = STP_LOOKUP,   handling = hash,   ws = 0x71a4204c {      id = "sess",     {s,f,r,e} = {0x71a42534,,+672,(nil),+16384},   },     worke
    r = 0x1f5f30d8 {     },     vcl = {       srcname = {         "input",         "Default",       },     }, },

    还是参考官方文档的Performance Tuning

    • -h classic,500009 (default: 16383)

    To keep hash lookups fast, you should not have more than 10 objects per hash bucket. If you have 3 million objects, number of objects should be at least 300000. The number should be a prime number. You can generate one on http://www.prime-numbers.org/.

    于是根据Varnish创建的object数目慢慢调大-h的参数值,最后终于彻底解决了子进程自动重启的问题。

    顺带提一下Varnish不重启进程让修改后的配置文件立刻生效的方法

    1. telnet登陆到Varnish的管理端口

    2. vcl.load <configname> <configpath>

    configname可以自己设定,想叫啥都行。configpath就是配置文件的完整路径,比如/usr/local/varnish/etc/varnish/default.vcl

    3. vcl.use <configname>

    第二步和第三步如果成功会返回代码200,全部操作完成后退出即可。

    关于管理台的运用其实很简单,telnet登陆上以后执行help就一目了然了。

    参考文档

    http://varnish.projects.linpro.no/wiki/Performance


    随机文章:

    用Varnish实现图片防盗链 2009-01-08
    Varnish更新到2.0.4 2009-04-13
    Varnish无法分配内存导致自动重启子进程的问题 2009-03-11
    VCL - Varnish configuration Language 2009-02-11
    用Varnish搭建Cache服务器 2008-10-10

    收藏到:Del.icio.us




    Tag:varnish cache vcl
    引用地址:
    Kevin 发表于10:13:56 | 编辑 | 继续话题 | 转发 | 分享 0
立即注册PayPal并开始接受信用卡付款。

搜索

feedsky
抓虾
google reader
my yahoo
鲜果
有道
九点

最新日志

  • Ubuntu 9.10禁用“最近的文档”
  • 在Linux下给网卡做bond
  • Farewell All
  • [TED]吉米·威尔斯叙说Wikipedia(维基百科)的诞生
  • 我的第一个TED Talk Translation
  • twitter最新IP
  • lighttpd的日志rotate
  • 受宠若惊
  • lighttpd+modcache实现对小图片的Cache
  • 正式成为TED Translators的一份子
全部日志>>

最新评论

  • sery:Kevin回复sery说: 我还没遇到过这个问题,不过...
  • sery:谢谢回复。 我现在用了64位的系统,但执行 varni...
  • sery:varnish 在32位的系统只能到2G。请问你怎么到的...
  • 稀饭:你的Varnish并发到4w后dmesg会出现 TCP...
  • Tina:回来了,也无法联系你了哈,呵呵,邮件也没有人回呀,等你消...
  • Tina:博主,怎么联系你呢,我给你发了EMAIL...
  • niule:谢谢,确实是-w参数会有问题,调整了就可以了! thx...
  • beibei.shi:余哥,祝您在那里一切顺利,很感谢您的指点,感激不尽!...
  • 奥德:很高兴认识你,有重要问题请教你,关于apache日志导成...
  • snow:....不会吧 混了几年也不觉得啊...

Tag

  • linux[61]
  • shell[20]
  • varnish[9]
  • cache[9]
  • programming[9]
  • unix[9]
  • 监控[8]
  • nagios[7]
More..
  • RSS 什么是RSS?
    用IM提醒我内容更新
    订阅到QQ邮箱
    订阅到鲜果阅读器
    订阅到Google阅读器
    订阅到抓虾阅读器
  • 《城客》第四期:创意之城
    博客大巴
    博客大巴使用指南
    博客大巴模板中心
    免费注册博客大巴
    一键博客搬家工具
    中文互动杂志城客
Copyright © 2002-2009 BlogBus.com, All Rights Reserved. 博客大巴 版权所有
博客大巴模板设计:新绿 | 作者: 饭团