[Varnish] #367: Varnish child dies
Varnish
varnish-bugs at projects.linpro.no
Tue Nov 4 13:53:58 CET 2008
#367: Varnish child dies
----------------------+-----------------------------------------------------
Reporter: j0nnybe | Owner: phk
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 2.0
Severity: normal | Keywords: 2.0.1
----------------------+-----------------------------------------------------
From /var/log/syslog on our server:
{{{
Nov 4 13:32:32 www6 varnishd[2648]: Child (5711) died signal=6
Nov 4 13:32:32 www6 varnishd[2648]: Child (5711) Panic message: Assert
error in exp_timer(), cache_expire.c line 332: Condition(sp->handling ==
VCL_RET_DISCARD) not true. thread = (cache-timeout)
Nov 4 13:32:32 www6 varnishd[2648]: Child cleanup complete
Nov 4 13:32:32 www6 varnishd[2648]: child (5793) Started
Nov 4 13:32:32 www6 varnishd[2648]: Child (5793) said Closed fds: 4 5 6
10 11 13 14
Nov 4 13:32:32 www6 varnishd[2648]: Child (5793) said Child starts
Nov 4 13:32:32 www6 varnishd[2648]: Child (5793) said managed to mmap
1073741824 bytes of 1073741824
Nov 4 13:32:32 www6 varnishd[2648]: Child (5793) said Ready
Nov 4 13:37:43 www6 varnishd[2648]: Child (5793) died signal=6
Nov 4 13:37:43 www6 varnishd[2648]: Child (5793) Panic message: Assert
error in exp_timer(), cache_expire.c line 332: Condition(sp->handling ==
VCL_RET_DISCARD) not true. thread = (cache-timeout)
Nov 4 13:37:43 www6 varnishd[2648]: Child cleanup complete
Nov 4 13:37:43 www6 varnishd[2648]: child (5908) Started
Nov 4 13:37:43 www6 varnishd[2648]: Child (5908) said Closed fds: 4 5 6
10 11 13 14
Nov 4 13:37:43 www6 varnishd[2648]: Child (5908) said Child starts
Nov 4 13:37:43 www6 varnishd[2648]: Child (5908) said managed to mmap
1073741824 bytes of 1073741824
Nov 4 13:37:43 www6 varnishd[2648]: Child (5908) said Ready
Nov 4 13:42:54 www6 varnishd[2648]: Child (5908) died signal=6
Nov 4 13:42:54 www6 varnishd[2648]: Child (5908) Panic message: Assert
error in exp_timer(), cache_expire.c line 332: Condition(sp->handling ==
VCL_RET_DISCARD) not true. thread = (cache-timeout)
Nov 4 13:42:54 www6 varnishd[2648]: Child cleanup complete
Nov 4 13:42:54 www6 varnishd[2648]: child (6007) Started
Nov 4 13:42:54 www6 varnishd[2648]: Child (6007) said Closed fds: 4 5 6
10 11 13 14
Nov 4 13:42:54 www6 varnishd[2648]: Child (6007) said Child starts
Nov 4 13:42:54 www6 varnishd[2648]: Child (6007) said managed to mmap
1073741824 bytes of 1073741824
Nov 4 13:42:54 www6 varnishd[2648]: Child (6007) said Ready
}}}
We use this vcl-config:
{{{
backend b1 {
.host = "127.0.0.1";
.port = "6081";
}
acl purge {
"localhost";
}
## Called when a client request is received
#
#pipe = just a pipe through varnish. No checks whatsoever
#pass = Go through all checks -> everything, just dont lookup in the cache
sub vcl_recv {
# Add a unique header containing the client address
unset req.http.X-Forwarded-For;
set req.http.X-Forwarded-For = client.ip;
##### always cache these items:
## images
if (req.request == "GET" && req.url ~
"\.(gif|jpg|jpeg|bmp|png|tiff|tif|ico|img|tga|wmf)$") {
set req.backend = b1;
lookup;
}
## various other content pages
if (req.request == "GET" && req.url ~ "\.(css|js)$") {
set req.backend = b1;
lookup;
}
## multimedia
if (req.request == "GET" && req.url ~ "\.(svg|swf|mov|avi|wmv)$")
{
set req.backend = b1;
lookup;
}
#### do not cache these files
# if (req.request == "GET" && req.url ~ "\.(cfm)$") {
# pass;
# }
#### do not cache these rules:
# pass mode can't handle POST (yet)
if (req.request == "POST") {
pipe;
}
if (req.request != "GET" && req.request != "HEAD") {
pipe;
}
if (req.http.Expect) {
pipe;
}
if (req.http.Authenticate || req.http.Authorization) {
pass;
}
#### if there is a purge make sure its coming from $localhost
if (req.request == "PURGE") {
if(!client.ip ~ purge) {
error 405 "Not Allowed";
}
purge_url(req.http.X-Purge-Url);
error 200 "Purged";
}
####
#### unknown function to "normalize the Accept-Encoding headers"
if (req.http.Accept-Encoding) {
if (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
unset req.http.Accept-Encoding;
}
}
#### don't cache authenticated sessions
if (req.http.Cookie && req.http.Cookie ~ "is_logged_in=") {
pipe;
}
// Varnish doesn't do INM requests so pass it through if no If-
Modified-Since was sent
if (req.http.If-None-Match && !req.http.If-Modified-Since) {
pass;
}
#### if it passes all these tests, do a lookup anyway;
lookup;
}
#
## Called when entering pipe mode
#
sub vcl_pipe {
pipe;
}
#
## Called when entering pass mode
#
sub vcl_pass {
pass;
}
#
## Called when entering an object into the cache
#
sub vcl_hash {
set req.hash += req.url;
set req.hash += req.http.host;
hash;
}
#
## Called when the requested object was found in the cache
#
sub vcl_hit {
# if (obj.http.X-Cache == "MISS") {
# set obj.http.X-Cache = "HIT";
# }
if (!obj.cacheable) {
pass;
}
deliver;
}
#
## Called when the requested object was not found in the cache
#
sub vcl_miss {
fetch;
}
#
## Called when the requested object has been retrieved from the
## backend, or the request to the backend has failed
#
sub vcl_fetch {
# default time to live for cache objects
set obj.ttl = 300s;
if (!obj.cacheable) {
pass;
}
if (obj.http.Set-Cookie ~ "is_logged_in=deleted(.*)") {
deliver;
}
if (obj.http.Set-Cookie) {
pass;
}
if (req.request == "GET" && req.url ~
"\.(gif|jpg|jpeg|bmp|png|tiff|tif|ico|img|tga|wmf)$") {
set obj.ttl = 600s;
deliver;
}
## various other content pages
if (req.request == "GET" && req.url ~ "\.(css|js|html)$") {
set obj.ttl = 600s;
deliver;
}
## multimedia
if (req.request == "GET" && req.url ~
"\.(svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv)$") {
set obj.ttl = 600s;
deliver;
}
# for varnish 2.0:
# set obj.prefetch = -30s;
deliver;
}
#
#
## Called before a cached object is delivered to the client
#
sub vcl_deliver {
deliver;
}
#
## Called when an object nears its expiry time
#
sub vcl_timeout {
fetch;
}
#
## Called when an object is about to be discarded
#
sub vcl_discard {
discard;
}
}}}
--
Ticket URL: <http://varnish.projects.linpro.no/ticket/367>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list