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

Use srcaddr mutex for srcaddr stats update to reduce contention on stat_mtx


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1034 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent bdbb106b
......@@ -201,15 +201,17 @@ SES_Charge(struct sess *sp)
ses_sum_acct(&sp->acct, a);
LOCK(&stat_mtx);
if (sp->srcaddr != NULL) {
LOCK(&sp->srcaddr->sah->mtx);
b = &sp->srcaddr->acct;
ses_sum_acct(b, a);
VSL(SLT_StatAddr, 0, "%s 0 %d %ju %ju %ju %ju %ju %ju %ju",
sp->srcaddr->addr, sp->t_end.tv_sec - b->first,
b->sess, b->req, b->pipe, b->pass,
b->fetch, b->hdrbytes, b->bodybytes);
UNLOCK(&sp->srcaddr->sah->mtx);
}
LOCK(&stat_mtx);
VSL_stats->s_sess += a->sess;
VSL_stats->s_req += a->req;
VSL_stats->s_pipe += a->pipe;
......
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