Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdp-pesi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
uplex-varnish
libvdp-pesi
Commits
bcd8e84b
Commit
bcd8e84b
authored
Aug 02, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the PESI.no_thread counter, and a corresponding log error message.
parent
094feed0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
485 additions
and
8 deletions
+485
-8
.gitignore
.gitignore
+2
-0
configure.ac
configure.ac
+1
-0
Makefile.am
src/Makefile.am
+10
-3
pesi.vsc
src/pesi.vsc
+15
-0
00basic.vtc
src/tests/00basic.vtc
+17
-0
no_thread.vtc
src/tests/no_thread.vtc
+408
-0
vdp_pesi.c
src/vdp_pesi.c
+32
-5
No files found.
.gitignore
View file @
bcd8e84b
...
@@ -32,6 +32,8 @@ Makefile.in
...
@@ -32,6 +32,8 @@ Makefile.in
/src/vcc_if.c
/src/vcc_if.c
/src/vcc_if.h
/src/vcc_if.h
/src/vmod_*rst
/src/vmod_*rst
/src/VSC_pesi.c
/src/VSC_pesi.h
/src/tests/*.log
/src/tests/*.log
/src/tests/*.trs
/src/tests/*.trs
...
...
configure.ac
View file @
bcd8e84b
...
@@ -39,6 +39,7 @@ m4_ifndef([VARNISH_PREREQ], AC_MSG_ERROR([Need varnish.m4 -- see README.rst]))
...
@@ -39,6 +39,7 @@ m4_ifndef([VARNISH_PREREQ], AC_MSG_ERROR([Need varnish.m4 -- see README.rst]))
VARNISH_PREREQ([trunk])
VARNISH_PREREQ([trunk])
VARNISH_VMODS([pesi])
VARNISH_VMODS([pesi])
VARNISH_COUNTERS([pesi])
VMOD_TESTS="$(cd $srcdir/src && echo tests/*.vtc)"
VMOD_TESTS="$(cd $srcdir/src && echo tests/*.vtc)"
AC_SUBST(VMOD_TESTS)
AC_SUBST(VMOD_TESTS)
...
...
src/Makefile.am
View file @
bcd8e84b
...
@@ -16,11 +16,15 @@ libvmod_pesi_la_SOURCES = \
...
@@ -16,11 +16,15 @@ libvmod_pesi_la_SOURCES = \
nodist_libvmod_pesi_la_SOURCES
=
\
nodist_libvmod_pesi_la_SOURCES
=
\
vcc_if.c
\
vcc_if.c
\
vcc_if.h
vcc_if.h
\
VSC_pesi.c
\
VSC_pesi.h
dist_man_MANS
=
vdp_pesi.3
dist_man_MANS
=
vdp_pesi.3
vdp_pesi.lo
:
vcc_if.h
@BUILD_VSC_PESI@
vdp_pesi.lo
:
vcc_if.h VSC_pesi.c VSC_pesi.h
vcc_if.h vmod_pesi.rst vmod_pesi.man.rst
:
vcc_if.c
vcc_if.h vmod_pesi.rst vmod_pesi.man.rst
:
vcc_if.c
...
@@ -45,6 +49,7 @@ TESTS = @VMOD_TESTS@
...
@@ -45,6 +49,7 @@ TESTS = @VMOD_TESTS@
EXTRA_DIST
=
\
EXTRA_DIST
=
\
vdp_pesi.vcc
\
vdp_pesi.vcc
\
selector.vsc
\
$(VMOD_TESTS)
$(VMOD_TESTS)
CLEANFILES
=
\
CLEANFILES
=
\
...
@@ -52,4 +57,6 @@ CLEANFILES = \
...
@@ -52,4 +57,6 @@ CLEANFILES = \
$(builddir)
/vcc_if.h
\
$(builddir)
/vcc_if.h
\
$(builddir)
/vmod_pesi.rst
\
$(builddir)
/vmod_pesi.rst
\
$(builddir)
/vmod_pesi.man.rst
\
$(builddir)
/vmod_pesi.man.rst
\
$(builddir)
/vdp_pesi.3
$(builddir)
/vdp_pesi.3
\
$(builddir)
/VSC_pesi.c
\
$(builddir)
/VSC_pesi.h
src/pesi.vsc
0 → 100644
View file @
bcd8e84b
..
This is *NOT* a RST file but the syntax has been chosen so
that it may become an RST file at some later date.
.. varnish_vsc_begin:: pesi
:oneliner: VDP pesi stats
:order: 90
.. varnish_vsc:: no_thread
:type: counter
:oneliner: No threads available for parallel ESI
Number of times no threads were available for parallel ESI.
.. varnish_vsc_end:: pesi
src/tests/00basic.vtc
View file @
bcd8e84b
...
@@ -12,6 +12,13 @@ varnish v1 -expect MEMPOOL.pesi.pool > 0
...
@@ -12,6 +12,13 @@ varnish v1 -expect MEMPOOL.pesi.pool > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -vsc PESI.*
varnish v1 -expect PESI.no_thread == 0
varnish v1 -vsc LCK.pesi.*
varnish v1 -expect LCK.pesi.stats.creat == 1
varnish v1 -expect LCK.pesi.stats.locks == 0
varnish v1 -vcl {backend b { .host = "${bad_ip}"; }}
varnish v1 -vcl {backend b { .host = "${bad_ip}"; }}
varnish v1 -vsc MEMPOOL.pesi.*
varnish v1 -vsc MEMPOOL.pesi.*
...
@@ -42,6 +49,9 @@ varnish v1 -expect MEMPOOL.pesi.pool > 0
...
@@ -42,6 +49,9 @@ varnish v1 -expect MEMPOOL.pesi.pool > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -vsc PESI.*
varnish v1 -expect PESI.no_thread == 0
varnish v1 -cli "vcl.state vcl2 warm"
varnish v1 -cli "vcl.state vcl2 warm"
varnish v1 -vsc MEMPOOL.pesi.*
varnish v1 -vsc MEMPOOL.pesi.*
...
@@ -49,6 +59,13 @@ varnish v1 -expect MEMPOOL.pesi.pool > 0
...
@@ -49,6 +59,13 @@ varnish v1 -expect MEMPOOL.pesi.pool > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -vsc PESI.*
varnish v1 -expect PESI.no_thread == 0
varnish v1 -vsc LCK.pesi.*
varnish v1 -expect LCK.pesi.stats.creat == 1
varnish v1 -expect LCK.pesi.stats.locks == 0
varnish v1 -cli "vcl.show vcl1"
varnish v1 -cli "vcl.show vcl1"
varnish v1 -cli "vcl.use vcl2"
varnish v1 -cli "vcl.use vcl2"
varnish v1 -cli "vcl.discard vcl1"
varnish v1 -cli "vcl.discard vcl1"
...
...
src/tests/no_thread.vtc
0 → 100644
View file @
bcd8e84b
This diff is collapsed.
Click to expand it.
src/vdp_pesi.c
View file @
bcd8e84b
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
#include "vqueue.h"
#include "vqueue.h"
#include "vcc_if.h"
#include "vcc_if.h"
#include "VSC_pesi.h"
#define VFAIL(ctx, fmt, ...) \
#define VFAIL(ctx, fmt, ...) \
VRT_fail((ctx), "vdp pesi failure: " fmt, __VA_ARGS__)
VRT_fail((ctx), "vdp pesi failure: " fmt, __VA_ARGS__)
...
@@ -328,6 +329,8 @@ struct pesi {
...
@@ -328,6 +329,8 @@ struct pesi {
struct
pecx
pecx
[
1
];
struct
pecx
pecx
[
1
];
VTAILQ_ENTRY
(
pesi
)
list
;
VTAILQ_ENTRY
(
pesi
)
list
;
unsigned
no_thread
;
};
};
/* Forward declarations */
/* Forward declarations */
...
@@ -348,10 +351,12 @@ const void * const priv_task_id_cfg = &priv_task_id_cfg;
...
@@ -348,10 +351,12 @@ const void * const priv_task_id_cfg = &priv_task_id_cfg;
/* shared object globals */
/* shared object globals */
static
unsigned
loadcnt
=
0
,
warmcnt
=
0
;
static
unsigned
loadcnt
=
0
,
warmcnt
=
0
;
static
struct
VSC_lck
*
lck_bytes_tree
,
*
lck_pesi_tree
;
static
struct
VSC_lck
*
lck_bytes_tree
,
*
lck_pesi_tree
,
*
lck_stats
;
static
struct
vsc_seg
*
vsc_seg
=
NULL
;
static
struct
vsc_seg
*
vsc_seg
=
NULL
,
*
pesi_vsc_seg
=
NULL
;
static
struct
mempool
*
mempool
=
NULL
;
static
struct
mempool
*
mempool
=
NULL
;
static
unsigned
node_alloc_sz
;
static
unsigned
node_alloc_sz
;
static
struct
VSC_pesi
*
stats
;
static
struct
lock
stats_lock
;
/* also used by our version of cache_esi_deliver.c */
/* also used by our version of cache_esi_deliver.c */
...
@@ -1249,9 +1254,13 @@ vped_include(struct req *preq, const char *src, const char *host,
...
@@ -1249,9 +1254,13 @@ vped_include(struct req *preq, const char *src, const char *host,
if
(
Pool_Task_Arg
(
wrk
,
TASK_QUEUE_REQ
,
if
(
Pool_Task_Arg
(
wrk
,
TASK_QUEUE_REQ
,
ved_task
,
&
req
,
sizeof
req
)
==
1
)
ved_task
,
&
req
,
sizeof
req
)
==
1
)
return
(
1
);
return
(
1
);
pesi
->
no_thread
++
;
VSLb
(
preq
->
vsl
,
SLT_Error
,
"vdp pesi: No thread available "
"for ESI subrequest %u, continuing in serial"
,
VXID
(
req
->
vsl
->
wid
));
/*
/*
* XXX @geoff add counter
*
* we can not use the self-rescheduling facility of
* we can not use the self-rescheduling facility of
* Pool_Task_Arg because we cannot unschedule ourself
* Pool_Task_Arg because we cannot unschedule ourself
*/
*/
...
@@ -2299,6 +2308,12 @@ vdp_pesi_fini(struct req *req, void **priv)
...
@@ -2299,6 +2308,12 @@ vdp_pesi_fini(struct req *req, void **priv)
CHECK_OBJ_NOTNULL
(
bytes_tree
,
BYTES_TREE_MAGIC
);
CHECK_OBJ_NOTNULL
(
bytes_tree
,
BYTES_TREE_MAGIC
);
assert
(
bytes_tree
==
pesi_tree
->
tree
);
assert
(
bytes_tree
==
pesi_tree
->
tree
);
if
(
pesi
->
no_thread
!=
0
)
{
Lck_Lock
(
&
stats_lock
);
stats
->
no_thread
+=
pesi
->
no_thread
;
Lck_Unlock
(
&
stats_lock
);
}
pesi_destroy
(
&
pesi
);
pesi_destroy
(
&
pesi
);
task_fini
(
pesi_tree
,
pesi
);
task_fini
(
pesi_tree
,
pesi
);
...
@@ -3104,8 +3119,15 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
...
@@ -3104,8 +3119,15 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
"pesi.bytes_tree"
);
"pesi.bytes_tree"
);
lck_pesi_tree
=
Lck_CreateClass
(
&
vsc_seg
,
lck_pesi_tree
=
Lck_CreateClass
(
&
vsc_seg
,
"pesi.pesi_tree"
);
"pesi.pesi_tree"
);
lck_stats
=
Lck_CreateClass
(
&
vsc_seg
,
"pesi.stats"
);
AN
(
lck_bytes_tree
);
AN
(
lck_bytes_tree
);
AN
(
lck_pesi_tree
);
AN
(
lck_pesi_tree
);
AZ
(
pesi_vsc_seg
);
stats
=
VSC_pesi_New
(
NULL
,
&
pesi_vsc_seg
,
""
);
AN
(
stats
);
AN
(
pesi_vsc_seg
);
Lck_New
(
&
stats_lock
,
lck_stats
);
}
}
VRT_AddVDP
(
ctx
,
&
VDP_pesi
);
VRT_AddVDP
(
ctx
,
&
VDP_pesi
);
...
@@ -3114,14 +3136,18 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
...
@@ -3114,14 +3136,18 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
VRT_RemoveVDP
(
ctx
,
&
VDP_pesi
);
VRT_RemoveVDP
(
ctx
,
&
VDP_pesi
);
AN
(
loadcnt
);
AN
(
loadcnt
);
if
(
--
loadcnt
==
0
)
if
(
--
loadcnt
==
0
)
{
Lck_Delete
(
&
stats_lock
);
Lck_DestroyClass
(
&
vsc_seg
);
Lck_DestroyClass
(
&
vsc_seg
);
VSC_pesi_Destroy
(
&
pesi_vsc_seg
);
}
break
;
break
;
case
VCL_EVENT_WARM
:
case
VCL_EVENT_WARM
:
if
(
warmcnt
++
==
0
)
{
if
(
warmcnt
++
==
0
)
{
AZ
(
mempool
);
AZ
(
mempool
);
mempool
=
mpl_init
();
mempool
=
mpl_init
();
AN
(
mempool
);
AN
(
mempool
);
VRT_VSC_Reveal
(
pesi_vsc_seg
);
}
}
break
;
break
;
case
VCL_EVENT_COLD
:
case
VCL_EVENT_COLD
:
...
@@ -3130,6 +3156,7 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
...
@@ -3130,6 +3156,7 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
AN
(
mempool
);
AN
(
mempool
);
mpl_fini
(
&
mempool
);
mpl_fini
(
&
mempool
);
AZ
(
mempool
);
AZ
(
mempool
);
VRT_VSC_Hide
(
pesi_vsc_seg
);
}
}
break
;
break
;
default:
default:
...
...
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