Project

General

Profile

Actions

Bug #2851

closed

Varnish3 config: add option to disable probing

Added by Torben Hørup over 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Varnish
Target version:
-
Start date:
03/02/2013
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

Probing is not relevant for all backend targets. Eg: i currently use a varnish setup where a single backend target is protected with http basic auth, but this protection marks the target as down and varnish refuses to send requests to it. Therefore the gui must add an option to disable to probing.

Actions #1

Updated by Torben Hørup over 12 years ago

First patch: add a disable option to gui:

--- varnish_backends.xml        2013-03-02 20:49:28.000000000 +0100
+++ varnish_backends.orig       2013-03-02 20:31:16.000000000 +0100
@@ -11,7 +11,7 @@
     Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
     Copyright (C) 2011 Marcello Coutinho
     All rights reserved.
-/*/
+*/
 /* ========================================================================== */
 /*
     Redistribution and use in source and binary forms, with or without
@@ -221,12 +221,6 @@
                        <type>input</type>
                </field>
                <field>
-                       <fielddescr>Disable Probe</fielddescr>
-                       <fieldname>probe_disable</fieldname>
-                       <description>Check to disable probing for this backend</description>
-                       <type>checkbox</type>
-               </field>
-               <field>
                        <fielddescr>Mappings</fielddescr>
                        <fieldname>Mappings</fieldname>
                        <type>listtopic</type>

Actions #2

Updated by Torben Hørup over 12 years ago

Second patch: respect the probe_disable option in code generator:

--- varnish.inc 2013-03-02 21:08:27.000000000 +0100
+++ varnish_inc.orig    2013-03-02 20:18:22.000000000 +0100
@@ -1,4 +1,4 @@
-/<?php
+<?php
 /* ========================================================================== */
 /*
        varnish.inc
@@ -329,22 +329,6 @@
                                $probe_threshold = $backend['probe_threshold'];
                        else
                                $probe_threshold = "5";
-
-
-                       if ($backend['probe_disable']) {
-                               $probe = "";
-                       } else {
-                               $probe = <<<EOFPROBE
-       .probe = {
-                {$probe_url}
-               .interval = {$probe_interval};
-               .timeout = {$probe_timeout};
-               .window = {$probe_window};
-               .threshold = {$probe_threshold};
-       }
-EOFPROBE;
-                       }
-
                        if (isset($probe_threshold)){
                                #last parameter set ,so write conf if backend is in use
                                if ($backends_in_use[$backend['backendname']] != ""){
@@ -356,7 +340,13 @@
        .port = "{$backend['port']}";
        .first_byte_timeout = {$first_byte_timeout};
        .connect_timeout = {$connect_timeout};
-{$probe}
+       .probe = {
+               {$probe_url}
+               .interval = {$probe_interval};
+               .timeout = {$probe_timeout};
+               .window = {$probe_window};
+               .threshold = {$probe_threshold};
+       }
 }

Actions #3

Updated by Torben Hørup over 12 years ago

Hmm got the patches reversed. Please ignore/delete the previous and use these instead

--- varnish_backends.orig       2013-03-02 20:31:16.000000000 +0100
+++ varnish_backends.xml        2013-03-02 20:49:28.000000000 +0100
@@ -11,7 +11,7 @@
     Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
     Copyright (C) 2011 Marcello Coutinho
     All rights reserved.
-*/
+/*/
 /* ========================================================================== */
 /*
     Redistribution and use in source and binary forms, with or without
@@ -221,6 +221,12 @@
                        <type>input</type>
                </field>
                <field>
+                       <fielddescr>Disable Probe</fielddescr>
+                       <fieldname>probe_disable</fieldname>
+                       <description>Check to disable probing for this backend</description>
+                       <type>checkbox</type>
+               </field>
+               <field>
                        <fielddescr>Mappings</fielddescr>
                        <fieldname>Mappings</fieldname>

--- varnish_inc.orig    2013-03-02 20:18:22.000000000 +0100
+++ varnish.inc 2013-03-02 21:08:27.000000000 +0100
@@ -1,4 +1,4 @@
-<?php
+/<?php
 /* ========================================================================== */
 /*
        varnish.inc
@@ -329,6 +329,22 @@
                                $probe_threshold = $backend['probe_threshold'];
                        else
                                $probe_threshold = "5";
+
+
+                       if ($backend['probe_disable']) {
+                               $probe = "";
+                       } else {
+                               $probe = <<<EOFPROBE
+       .probe = {
+                {$probe_url}
+               .interval = {$probe_interval};
+               .timeout = {$probe_timeout};
+               .window = {$probe_window};
+               .threshold = {$probe_threshold};
+       }
+EOFPROBE;
+                       }
+
                        if (isset($probe_threshold)){
                                #last parameter set ,so write conf if backend is in use
                                if ($backends_in_use[$backend['backendname']] != ""){
@@ -340,13 +356,7 @@
        .port = "{$backend['port']}";
        .first_byte_timeout = {$first_byte_timeout};
        .connect_timeout = {$connect_timeout};
-       .probe = {
-               {$probe_url}
-               .interval = {$probe_interval};
-               .timeout = {$probe_timeout};
-               .window = {$probe_window};
-               .threshold = {$probe_threshold};
-       }
+{$probe}
 }

Actions #4

Updated by Chris Buechler over 12 years ago

please make a pull request with your changes.
https://help.github.com/articles/using-pull-requests

Actions #6

Updated by Chris Buechler over 10 years ago

  • Category set to Varnish
  • Status changed from New to Resolved
Actions

Also available in: Atom PDF