mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-15 20:12:08 +01:00
MINOR: queues: Check minconn first in srv_dynamic_maxconn()
In srv_dynamic_maxconn(), we'll decide that the max number of connection is the server's maxconn if 1) the proxy's number of connection is over fullconn, or if minconn was not set. Check if minconn is not set first, as it will be true most of the time, and as the proxy's "beconn" variable is in a busy cache line, it can be costly to access it, while minconn/maxconn is in a cache line that should very rarely change.
This commit is contained in:
parent
c622ed23c8
commit
a8f50cff7e
@ -105,11 +105,8 @@ unsigned int srv_dynamic_maxconn(const struct server *s)
|
||||
{
|
||||
unsigned int max;
|
||||
|
||||
if (s->proxy->beconn >= s->proxy->fullconn)
|
||||
/* no fullconn or proxy is full */
|
||||
max = s->maxconn;
|
||||
else if (s->minconn == s->maxconn)
|
||||
/* static limit */
|
||||
if (s->minconn == s->maxconn || s->proxy->beconn >= s->proxy->fullconn)
|
||||
/* static limit, or no fullconn or proxy is full */
|
||||
max = s->maxconn;
|
||||
else max = MAX(s->minconn,
|
||||
s->proxy->beconn * s->maxconn / s->proxy->fullconn);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user