r3873 - in trunk/varnish-cache: bin/varnishd include
phk at projects.linpro.no
phk at projects.linpro.no
Wed Mar 4 10:40:06 CET 2009
Author: phk
Date: 2009-03-04 10:40:06 +0100 (Wed, 04 Mar 2009)
New Revision: 3873
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_backend.c
trunk/varnish-cache/bin/varnishd/cache_http.c
trunk/varnish-cache/include/stat_field.h
Log:
Make n_bereq a worker-thead buffered counter and thus precise.
Any continous growth is now indications of leaks.
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2009-03-04 09:22:47 UTC (rev 3872)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2009-03-04 09:40:06 UTC (rev 3873)
@@ -439,7 +439,7 @@
void VBE_GetFd(struct sess *sp);
void VBE_ClosedFd(struct sess *sp);
void VBE_RecycleFd(struct sess *sp);
-struct bereq * VBE_new_bereq(void);
+struct bereq * VBE_new_bereq(struct sess *sp);
void VBE_free_bereq(struct bereq **bereq);
void VBE_AddHostHeader(const struct sess *sp);
void VBE_Poll(void);
Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c 2009-03-04 09:22:47 UTC (rev 3872)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2009-03-04 09:40:06 UTC (rev 3873)
@@ -142,7 +142,7 @@
*/
struct bereq *
-VBE_new_bereq(void)
+VBE_new_bereq(struct sess *sp)
{
struct bereq *bereq;
volatile unsigned len;
@@ -161,7 +161,7 @@
return (NULL);
bereq->magic = BEREQ_MAGIC;
WS_Init(bereq->ws, "bereq", bereq + 1, len);
- VSL_stats->n_bereq++;
+ sp->wrk->stats->n_bereq++;
}
http_Setup(bereq->bereq, bereq->ws);
http_Setup(bereq->beresp, bereq->ws);
Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c 2009-03-04 09:22:47 UTC (rev 3872)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c 2009-03-04 09:40:06 UTC (rev 3873)
@@ -635,7 +635,7 @@
struct http *hp;
AZ(sp->bereq);
- bereq = VBE_new_bereq();
+ bereq = VBE_new_bereq(sp);
AN(bereq);
hp = bereq->bereq;
hp->logtag = HTTP_Tx;
Modified: trunk/varnish-cache/include/stat_field.h
===================================================================
--- trunk/varnish-cache/include/stat_field.h 2009-03-04 09:22:47 UTC (rev 3872)
+++ trunk/varnish-cache/include/stat_field.h 2009-03-04 09:40:06 UTC (rev 3873)
@@ -55,7 +55,7 @@
MAC_STAT(n_smf_frag, uint64_t, 0, 'i', "N small free smf")
MAC_STAT(n_smf_large, uint64_t, 0, 'i', "N large free smf")
MAC_STAT(n_vbe_conn, uint64_t, 0, 'i', "N struct vbe_conn")
-MAC_STAT(n_bereq, uint64_t, 0, 'i', "N struct bereq")
+MAC_STAT(n_bereq, uint64_t, 1, 'i', "N struct bereq")
MAC_STAT(n_wrk, uint64_t, 0, 'i', "N worker threads")
MAC_STAT(n_wrk_create, uint64_t, 0, 'a', "N worker threads created")
MAC_STAT(n_wrk_failed, uint64_t, 0, 'a', "N worker threads not created")
More information about the varnish-commit
mailing list