<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color:black;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif">How can I probe a backend varnish? for example I have 2 layer varnish disk layer and ram layer and ram layer want to check the health of layer 2, How can I do this? I've
done something but I have error:</span>
<div style="color:black;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
<div><br>
sudo varnishadm backend.list -p</div>
<div>Backend name Admin Probe Last updated</div>
<div>boot.varnish_1 probe Sick 0/5</div>
<div> Current states good: 0 threshold: 3 window: 5</div>
<div> Average response time of good probes: 0.000000</div>
<div> Oldest ================================================== Newest</div>
<div> ---------------------------------------------------------------- Happy<br>
<br>
sudo varnishlog -g raw -i Backend_health
<div>0 Backend_health - boot.varnish_1 Still sick -------- 0 3 5 0.000000 0.000000 Open error 111 (Connection refused)</div>
</div>
<div><br>
</div>
<div>my config:</div>
<div>probe myprobe {
<div> .request =</div>
<div> "HEAD / HTTP/1.1"</div>
<div> "Connection: close"</div>
<div> "User-Agent: Varnish Health Probe";</div>
<div> .timeout = 1s;</div>
<div> .interval = 5s;</div>
<div> .window = 5;</div>
<div> .threshold = 3;</div>
}</div>
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Hamidreza Hosseini<br>
<b>Sent:</b> Thursday, February 18, 2021 5:31 AM<br>
<b>To:</b> varnish-misc@varnish-cache.org <varnish-misc@varnish-cache.org><br>
<b>Subject:</b> How to adjust priority for both backend healthy</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I have two backend that both of them are healthy and I use fallback for them and I want to say all request should goes to backend1 and if backend1 become unhealthy all requests should go to backend2 but backend1 has higher priority and when backend1 become
healthy, all requests should go to backend1,<br>
How can I define priority?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
my config:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
```</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
vcl 4.1;
<div><br>
</div>
<div>import directors;</div>
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div>probe myprobe {</div>
<div> .request =</div>
<div> "HEAD / HTTP/1.1"</div>
<div> "Connection: close"</div>
<div> "User-Agent: Varnish Health Probe";</div>
<div> .timeout = 1s;</div>
<div> .interval = 5s;</div>
<div> .window = 5;</div>
<div> .threshold = 3;</div>
<div>}</div>
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
backend backend1 { .host = "backend1"; .port = "8080"; .probe = myprobe; }
<div><br>
</div>
<div>backend backend2 { .host = "backend2"; .port = "8080"; .probe = myprobe; }</div>
<div>backend backend3 { .host = "backend3"; .port = "8080"; .probe = myprobe; }</div>
<br>
<div><br>
</div>
<div>sub vcl_init {</div>
<div><br>
</div>
<div> new backend2_cluster = directors.round_robin();</div>
<div> backend2_cluster.add_backend(backend2);</div>
<div> backend3_cluster.add_backend(backend3);</div>
<br>
<div><br>
</div>
<div> new backend_cluster_fb = directors.fallback();</div>
<div> backend1_fb.add_backend(backend1);</div>
<div> backend2_cluster_fb.add_backend(backend2_cluster.backend());</div>
<div>}</div>
<div><br>
</div>
<div>sub vcl_recv {</div>
<div> set req.backend_hint = backend_cluster_fb.backend();</div>
<div><br>
</div>
<div>}<br>
<br>
```<br>
</div>
<br>
</div>
</div>
</body>
</html>