mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-09 23:02:34 +02:00
MEDIUM: threads/proxy: Add a lock per proxy and atomically update proxy vars
Now, each proxy contains a lock that must be used when necessary to protect it. Moreover, all proxy's counters are now updated using atomic operations.
This commit is contained in:
committed by
Willy Tarreau
parent
8d8aa0d681
commit
ff8abcd31d
@@ -123,7 +123,7 @@ static struct stream *pendconn_get_next_strm(struct server *srv, struct proxy *p
|
||||
strm->target = &srv->obj_type;
|
||||
stream_add_srv_conn(strm, srv);
|
||||
srv->served++;
|
||||
srv->proxy->served++;
|
||||
HA_ATOMIC_ADD(&srv->proxy->served, 1);
|
||||
if (px->lbprm.server_take_conn)
|
||||
px->lbprm.server_take_conn(srv);
|
||||
|
||||
@@ -182,8 +182,7 @@ struct pendconn *pendconn_add(struct stream *strm)
|
||||
LIST_ADDQ(&strm->be->pendconns, &p->list);
|
||||
strm->be->nbpend++;
|
||||
strm->logs.prx_queue_size += strm->be->nbpend;
|
||||
if (strm->be->nbpend > strm->be->be_counters.nbpend_max)
|
||||
strm->be->be_counters.nbpend_max = strm->be->nbpend;
|
||||
HA_ATOMIC_UPDATE_MAX(&strm->be->be_counters.nbpend_max, strm->be->nbpend);
|
||||
}
|
||||
strm->be->totpend++;
|
||||
return p;
|
||||
|
||||
Reference in New Issue
Block a user