mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-18 19:50:54 +00:00
MINOR: listener: maintain a per-thread count of the number of connections on a listener
Having this information will help us improve thread-level distribution of incoming traffic.
This commit is contained in:
parent
3f0d02bbc2
commit
9e85318417
@ -214,6 +214,9 @@ struct listener {
|
||||
|
||||
const struct netns_entry *netns; /* network namespace of the listener*/
|
||||
|
||||
/* cache line boundary */
|
||||
unsigned int thr_conn[MAX_THREADS]; /* number of connections per thread */
|
||||
|
||||
/* cache line boundary */
|
||||
struct list by_fe; /* chaining in frontend's list of listeners */
|
||||
struct list by_bind; /* chaining in bind_conf's list of listeners */
|
||||
|
@ -653,6 +653,7 @@ void listener_accept(int fd)
|
||||
*/
|
||||
next_conn = 0;
|
||||
|
||||
HA_ATOMIC_ADD(&l->thr_conn[tid], 1);
|
||||
ret = l->accept(l, cfd, &addr);
|
||||
if (unlikely(ret <= 0)) {
|
||||
/* The connection was closed by stream_accept(). Either
|
||||
@ -723,6 +724,7 @@ void listener_release(struct listener *l)
|
||||
if (!(l->options & LI_O_UNLIMITED))
|
||||
HA_ATOMIC_SUB(&actconn, 1);
|
||||
HA_ATOMIC_SUB(&l->nbconn, 1);
|
||||
HA_ATOMIC_SUB(&l->thr_conn[tid], 1);
|
||||
if (l->state == LI_FULL)
|
||||
resume_listener(l);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user