Plz Help Varnish died signal=6 , keep panic and restart every few second - minute

M L ml at tinwong.com
Mon Sep 21 12:18:07 CEST 2009


Hi list , i have googled few day , have no luck to find any clue for my
problem  anyone have idea solve this problem thanks alot

Box config : centos 5.3 kernel 2.6.18-8.1.14.el5  64bit / varnish 2.0.4

varnishd -a 0.0.0.0:80 -T 127.0.0.1:3500 -p client_http11=on -f vconf2 -s
file,/usr/local/varnish/cache.bin,80G -h classic,500009 -p listen_depth=4096
-p obj_workspace=32768 -p sess_workspace=32768 -p send_timeout=327

from /var/log/message

Sep 20 21:26:36 x2
varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
Child (21934) died signal=6 Sep 20 21:26:36 x2
varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
Child (21934) Panic message: Assert error in VRT_IP_string(), cache_vrt.c
line 693: Condition((p = WS_Alloc(sp->http->ws, len)) != 0) nlient =
211.74.185.119:2909, step = STP_RECV, handling = error, err_code = 503,
err_reason = (null), ws = 0x2abeb5926078 { overflow id = "sess", {s,f,r,e} =
cname = { "input", "Default", }, }, },

Sep 20 21:26:36 x2
varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
child (21952) Started Sep 20 21:26:36 x2
varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
Child (21952) said Closed fds: 4 5 8 9 11 12 Sep 20 21:26:36 x2 varnishd
[21933] <http://varnish.projects.linpro.no/changeset/21933>: Child (21952)
said Child starts Sep 20 21:26:36 x2
varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
Child (21952) said managed to mmap 85899345920 bytes of 85899345920 Sep 20
21:26:36 x2 varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
Child (21952) said Ready Sep 20 21:28:10 x2
varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
Child (21952) died signal=6 Sep 20 21:28:10 x2
varnishd[21933]<http://varnish.projects.linpro.no/changeset/21933>:
Child (21952) Panic message: Assert error in WS_Release(), cache_ws.c line
170: Condition(bytes <= ws->e - ws->f) not true. thread = (10:32759, step =
STP_RECV, handling = error, err_code = 503, err_reason = (null), ws =
0x2abeb5a65078 { id = "sess", {s,f,r,e} = {0x2abeb5a65808+32738,+32
"Default", }, }, },


VCL config


backend default {
    .host = "10.0.0.5";
    .port = "80";
    .connect_timeout = 1s;
    .first_byte_timeout = 5s;
    .between_bytes_timeout = 2s;
}

backend srv1 {
    .host = "10.0.0.5";
    .port = "80";
    .connect_timeout = 1s;
    .first_byte_timeout = 5s;
    .between_bytes_timeout = 2s;
}

backend srv2 {
    .host = "10.0.0.5";
    .port = "80";
    .connect_timeout = 1s;
    .first_byte_timeout = 5s;
    .between_bytes_timeout = 2s;
}

acl purge {

    "localhost"; "127.0.0.1";
}

#recv
sub vcl_recv {

if (req.http.host ~ "www.foobar.com") {
    set req.http.host = "www.foobar.com";
    if (req.restarts == 0) {
    set req.backend = srv1;
    } else if (req.restarts == 1) {
    set req.backend = allhabit2;
    }

}elseif ( req.http.host ~ "www.zoobar.com") {
    set req.http.host = "www.zoobar.com";
    if (req.restarts == 0) {
        set req.backend = srv1;
        } else if (req.restarts == 1) {
        set req.backend = srv2;
        }

}elseif ( req.http.host ~ "www.yoobar.com") {
    set req.http.host = "www.yoobar.com";
    if (req.restarts == 0) {
        set req.backend = srv1;
        } else if (req.restarts == 1) {
        set req.backend = srv2;
        }

}elseif ( req.http.host ~ "218.242.39.202") {
    set req.http.host = "118.142.39.202";
    if (req.restarts == 0) {
        set req.backend = srv1;
        } else if (req.restarts == 1) {
        set req.backend = srv2;
        }

}elseif ( req.http.host ~ "218.242.39.203") {
    set req.http.host = "118.142.39.203";
    if (req.restarts == 0) {
        set req.backend = srv1;
        } else if (req.restarts == 1) {
        set req.backend = srv2;
        }

}elseif ( req.http.host ~ "204.186.59.41") {
    set req.http.host = "204.186.59.41";
    if (req.restarts == 0) {
        set req.backend = srv1;
        } else if (req.restarts == 1) {
        set req.backend = srv2;
        }

}elseif ( req.http.host ~ "204.126.59.45") {
    set req.http.host = "204.126.59.45";
    if (req.restarts == 0) {
        set req.backend = srv1;
        } else if (req.restarts == 1) {
        set req.backend = srv2;
        }

}else{
    error 401 "Bad Domain";
}

#set req.grace = 30s;

# Add a unique header containing the client address
remove req.http.X-Forwarded-For;
set    req.http.X-Forwarded-For = client.ip;
# [...]


if (req.request == "PURGE") {
    if(!client.ip ~ purge) {
        error 405 "Not Allowed";
    } lookup;}


#if (req.request != "GET" && req.request != "HEAD") {
#        pipe;
#    }

#if (req.request == "POST") {
#     pass;
# }

if (req.http.Expect) {
        pipe;
    }


if (req.request != "GET" &&
                req.request != "HEAD" &&
                req.request != "PUT" &&
                req.request != "POST" &&
                req.request != "TRACE" &&
                req.request != "OPTIONS" &&
                req.request != "DELETE") {
                        /* Non-RFC2616 or CONNECT which is weird. */
                        pipe;
        }
        if (req.request != "GET" && req.request != "HEAD") {
                /* We only deal with GET and HEAD by default */
                pass;
        }




if (req.http.Cache-Control ~ "no-cache") {
        pass;
    }

if (req.http.Authenticate) {
    pass;
  }

#if (req.http.Cookie) {
#    pass;
#  }

if (req.url ~
"\.(zip|ico|dat|torrent|png|gif|jpg|swf|css|js|bmp|bz2|tbz|mp3|ogg)$") {
    unset req.http.cookie;
    lookup;
#    unset req.http.authenticate;
    }

if (req.http.Accept-Encoding) {
    if (req.url ~
"\.(zip|ico|dat|torrent|png|gif|jpg|swf|css|js|bmp|bz2|tbz|mp3|ogg)$") {
            # No point in compressing these
            remove req.http.Accept-Encoding;
        } elsif (req.http.Accept-Encoding ~ "gzip") {
            set req.http.Accept-Encoding = "gzip";
        } elsif (req.http.Accept-Encoding ~ "deflate") {
            set req.http.Accept-Encoding = "deflate";
        } else {
            # unkown algorithm
            remove req.http.Accept-Encoding;
        }
    }


} #end recv


sub vcl_hash {
set req.hash += req.url;
set req.hash += req.http.host;
#set req.hash += req.http.cookie;
#set req.hash += server.ip;
hash;
}  #end hash

# sub vcl_hash {
#     set req.hash += req.url;
#     if (req.http.host) {
#         set req.hash += req.http.host;
#     } else {
#         set req.hash += server.ip;
#     }
#     hash;
# }


#if (req.http.Accept-Encoding ~ "gzip") {
#set req.hash += "gzip";
#}
#else if (req.http.Accept-Encoding ~ "deflate") {
#set req.hash += "deflate";
#}

#hash;
#}  #end hash


#sub vcl_hash {
#        set req.hash += req.url;
#        set req.hash += req.http.host;

#        if (req.http.Accept-Encoding ~ "gzip") {
#                set req.hash += "gzip";
#        }
#        else if (req.http.Accept-Encoding ~ "deflate") {
#                set req.hash += "deflate";
#        }
#}



# strip the cookie before the image is inserted into cache.
sub vcl_fetch {

#if (obj.status != 200 && obj.status != 302) {
#restart;
#}

    if(obj.http.Set-Cookie){
                pass;
                }


  if(obj.http.Pragma ~ "no-cache" ||
              obj.http.Cache-Control ~ "no-cache" ||
            obj.http.Cache-Control ~ "private"){
            pass;
            }

#    set obj.grace = 30s;

    if (req.url ~
"\.(zip|ico|dat|torrent|png|gif|jpg|swf|css|js|bmp|bz2|tbz|mp3|ogg)$") {
        unset obj.http.set-cookie;
        set obj.ttl = 1w;
               }


#    if (req.request == "GET" && req.url ~ "\.(txt|js)$") {
#                 set obj.ttl = 1d;
#               } else {
#                 set obj.ttl = 1w;
#               }

if (req.url ~
"\.(zip|ico|dat|torrent|png|gif|jpg|swf|css|js|bmp|bz2|tbz|mp3|ogg)$") {
unset obj.http.expires;
set obj.http.cache-control = "max-age=315360000, public";
set obj.ttl = 1w;
set obj.http.magicmarker = "1";
}



#    if (obj.cacheable) {
#                        /* Remove Expires from backend, it's not long
enough */
#                        unset obj.http.expires;

#                        /* Set the clients TTL on this object */
#                        set obj.http.cache-control = "max-age=315360000,
public";

#                        /* Set how long Varnish will keep it */
#                        set obj.ttl = 1w;

#                        /* marker for vcl_deliver to reset Age: */
#                        set obj.http.magicmarker = "1";
#                }


    } #fetch end




sub vcl_deliver {
                if (resp.http.magicmarker) {
                        /* Remove the magic marker */
                        unset resp.http.magicmarker;

                        /* By definition we have a fresh object */
                        set resp.http.age = "0";
        if (obj.hits > 0) {
                    set resp.http.X-Cache = "HIT";
            } else {
                    set resp.http.X-Cache = "MISS";
               }

                }



} #deliver end


sub vcl_pipe {
    # http://varnish.projects.linpro.no/ticket/451
    # This forces every pipe request to be the first one.
    set bereq.http.connection = "close";
} #pipe end




sub vcl_error {
    if (obj.status == 503) {
        restart;
    }
} #error end




Thanks

TW
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20090921/8e5e9265/attachment-0001.html>


More information about the varnish-misc mailing list