<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi all,<br>
<br>
I'm working with a set of varnish-caches (2.1.3) in front of some
round-robin director configured backends.<br>
Sometimes I experience a 503 error due to some unforseeable
circumstances like network hiccups, content server problems and
other magic... ;-)<br>
Nevertheless all backends are healthy regarding the large majority
of other requests (and watchdog of course), we deal with sporadic
failures here.<br>
<br>
Obviously I don't want those 503's to go through to the user.<br>
<br>
I inserted the following code in my vcl_fetch:<br>
<br>
if (beresp.status == 503) {<br>
set beresp.saintmode = 2s;<br>
restart;<br>
}<br>
<br>
This works quite well, the failed (503 delivering) request is
forwarded to the next backend in the director and is successfully
served then.<br>
<br>
What I am missing is the exact backend information which backend did
not serve the request or better said: where did the 503 come from?<br>
I already included some inline-C in order to send info to syslog,
but I am missing some VRT_(r_)something to find out the failing
backend without searching the backend's logfiles directly.<br>
<br>
My current syslog()-msg is:<br>
<br>
syslog (LOG_LOCAL7 | LOG_INFO, "VarnishLog(vcl_fetch): %s/%s[%s]
[REST=%02d] %s <a class="moz-txt-link-freetext" href="http://%s%s">http://%s%s</a>", <br>
VRT_backend_string(sp), VRT_r_server_hostname(sp),
VRT_IP_string(sp,VRT_r_server_ip(sp)), <br>
VRT_r_req_restarts(sp), VRT_r_req_request(sp), VRT_GetHdr(sp,
HDR_REQ, "\005host:"), VRT_r_req_url(sp));<br>
<br>
I managed to get the backend definition, but not the specific
backend machine name (or IP) from the backend director.<br>
<br>
... and: is there some sort of overview on which VRT_magic fields
(for use with inline-C) exists?<br>
<br>
Thanks in advance,<br>
Stefan<br>
<br>
<div class="moz-signature">-- <br>
<style>
.FONT8B {font-family:Geneva,Arial,Helvetica; font-size:8pt; color: blue }
.FONT8S {font-family:Geneva,Arial,Helvetica; font-size:8pt; color: #404050 }
</style>
<p class="FONT8B"><b>Dipl.-Inform. Stefan Pommerening<br>
Informatik-Büro: IT-Dienste & Projekte, Consulting &
Coaching</b><br>
<a class="moz-txt-link-freetext" href="http://www.dmsp.de">http://www.dmsp.de</a></p>
<br>
</div>
</body>
</html>