Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
dbc39e9f
Commit
dbc39e9f
authored
Mar 09, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable backend probes in cold vcls
parent
d4ec606c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
cache_backend.c
bin/varnishd/cache/cache_backend.c
+4
-0
cache_backend.h
bin/varnishd/cache/cache_backend.h
+1
-0
cache_backend_poll.c
bin/varnishd/cache/cache_backend_poll.c
+26
-4
No files found.
bin/varnishd/cache/cache_backend.c
View file @
dbc39e9f
...
...
@@ -332,6 +332,10 @@ VRT_event_vbe(VRT_CTX, enum vcl_event_e ev, const struct director *d,
assert
(
d
->
priv2
==
vrt
);
CAST_OBJ_NOTNULL
(
be
,
d
->
priv
,
BACKEND_MAGIC
);
if
(
be
->
probe
!=
NULL
&&
ev
==
VCL_EVENT_WARM
)
VBP_Control
(
be
,
0
);
if
(
be
->
probe
!=
NULL
&&
ev
==
VCL_EVENT_COLD
)
VBP_Control
(
be
,
1
);
}
void
...
...
bin/varnishd/cache/cache_backend.h
View file @
dbc39e9f
...
...
@@ -113,6 +113,7 @@ void VBE_DeleteBackend(struct backend *);
void
VBP_Insert
(
struct
backend
*
b
,
struct
vrt_backend_probe
const
*
p
,
const
char
*
hosthdr
);
void
VBP_Remove
(
struct
backend
*
b
);
void
VBP_Control
(
const
struct
backend
*
b
,
int
stop
);
void
VBP_Status
(
struct
cli
*
cli
,
const
struct
backend
*
,
int
details
);
struct
tcp_pool
*
VBT_Ref
(
const
struct
suckaddr
*
ip4
,
...
...
bin/varnishd/cache/cache_backend_poll.c
View file @
dbc39e9f
...
...
@@ -58,6 +58,7 @@ struct vbp_target {
#define VBP_TARGET_MAGIC 0x6b7cb656
struct
lock
mtx
;
int
disable
;
int
stop
;
struct
backend
*
backend
;
...
...
@@ -259,7 +260,8 @@ vbp_has_poked(struct vbp_target *vt)
vt
->
backend
->
vcl_name
,
logmsg
,
bits
,
vt
->
good
,
vt
->
probe
.
threshold
,
vt
->
probe
.
window
,
vt
->
last
,
vt
->
avg
,
vt
->
resp_buf
);
vt
->
backend
->
vsc
->
happy
=
vt
->
happy
;
if
(
!
vt
->
disable
)
vt
->
backend
->
vsc
->
happy
=
vt
->
happy
;
}
Lck_Unlock
(
&
vt
->
mtx
);
}
...
...
@@ -281,9 +283,11 @@ vbp_wrk_poll_backend(void *priv)
AN
(
vt
->
req
);
assert
(
vt
->
req_len
>
0
);
vbp_start_poke
(
vt
);
vbp_poke
(
vt
);
vbp_has_poked
(
vt
);
if
(
!
vt
->
disable
)
{
vbp_start_poke
(
vt
);
vbp_poke
(
vt
);
vbp_has_poked
(
vt
);
}
if
(
!
vt
->
stop
)
VTIM_sleep
(
vt
->
probe
.
interval
);
...
...
@@ -412,6 +416,24 @@ vbp_set_defaults(struct vbp_target *vt)
vt
->
probe
.
initial
=
vt
->
probe
.
threshold
;
}
/*--------------------------------------------------------------------
*/
void
VBP_Control
(
const
struct
backend
*
be
,
int
stop
)
{
struct
vbp_target
*
vt
;
ASSERT_CLI
();
CHECK_OBJ_NOTNULL
(
be
,
BACKEND_MAGIC
);
vt
=
be
->
probe
;
CHECK_OBJ_NOTNULL
(
vt
,
VBP_TARGET_MAGIC
);
Lck_Lock
(
&
vt
->
mtx
);
vt
->
disable
=
stop
;
Lck_Unlock
(
&
vt
->
mtx
);
}
/*--------------------------------------------------------------------
* Insert/Remove/Use called from cache_backend.c
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment