Commit 36029366 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove the backend connection memory structure cache, it predates

our import of JEmalloc, has been turned of by default and does
not improve performance when turned on.
parent 81a0fec2
......@@ -62,12 +62,6 @@ struct vdi_simple {
const struct vrt_backend *vrt;
};
/*
* List of cached vbcs, used if enabled in params/heritage
*/
static VTAILQ_HEAD(,vbc) vbcs = VTAILQ_HEAD_INITIALIZER(vbcs);
/*--------------------------------------------------------------------
* Create default Host: header for backend request
*/
......@@ -97,17 +91,10 @@ VBE_ReleaseConn(struct vbc *vc)
vc->addr = NULL;
vc->addrlen = 0;
vc->recycled = 0;
if (params->cache_vbcs) {
Lck_Lock(&VBE_mtx);
VTAILQ_INSERT_HEAD(&vbcs, vc, list);
VSC_main->backend_unused++;
Lck_Unlock(&VBE_mtx);
} else {
Lck_Lock(&VBE_mtx);
VSC_main->n_vbc--;
Lck_Unlock(&VBE_mtx);
free(vc);
}
Lck_Lock(&VBE_mtx);
VSC_main->n_vbc--;
Lck_Unlock(&VBE_mtx);
FREE_OBJ(vc);
}
#define FIND_TMO(tmx, dst, sp, be) \
......@@ -238,21 +225,8 @@ vbe_NewConn(void)
{
struct vbc *vc;
vc = VTAILQ_FIRST(&vbcs);
if (vc != NULL) {
Lck_Lock(&VBE_mtx);
vc = VTAILQ_FIRST(&vbcs);
if (vc != NULL) {
VSC_main->backend_unused--;
VTAILQ_REMOVE(&vbcs, vc, list);
}
Lck_Unlock(&VBE_mtx);
}
if (vc != NULL)
return (vc);
vc = calloc(sizeof *vc, 1);
ALLOC_OBJ(vc, VBC_MAGIC);
XXXAN(vc);
vc->magic = VBC_MAGIC;
vc->fd = -1;
Lck_Lock(&VBE_mtx);
VSC_main->n_vbc++;
......
......@@ -144,9 +144,6 @@ struct params {
/* Rush exponent */
unsigned rush_exponent;
/* Cache vbcs */
unsigned cache_vbcs;
/* Default connection_timeout */
double connect_timeout;
......
......@@ -656,10 +656,6 @@ static const struct parspec input_parspec[] = {
"Maximum depth of esi:include processing.\n",
0,
"5", "levels" },
{ "cache_vbcs", tweak_bool, &master.cache_vbcs, 0, 0,
"Cache vbc's or rely on malloc, that's the question.",
EXPERIMENTAL,
"off", "bool" },
{ "connect_timeout", tweak_timeout_double,
&master.connect_timeout,0, UINT_MAX,
"Default connection timeout for backend connections. "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment