mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-16 14:21:03 +01:00
MINOR: checks: start the checks in sleeping state
The CHK_ST_SLEEPING state was introduced by commit d114f4a68 ("MEDIUM:
checks: spread the checks load over random threads") to indicate that
a check was not currently bound to a thread and that it could easily
be migrated to any other thread. However it did not start the checks
in this state, meaning that they were not redispatchable on startup.
Sometimes under heavy load (e.g. when using SSL checks with OpenSSL 3.0)
the cost of setting up new connections is so high that some threads may
experience connection timeouts on startup. In this case it's better if
they can transfer their excess load to other idle threads. By just
marking the check as sleeping upon startup, we can do this and
significantly reduce the number of failed initial checks.
This commit is contained in:
parent
48442b8b15
commit
7163f95b43
@ -56,7 +56,7 @@ enum chk_result {
|
||||
#define CHK_ST_OUT_ALLOC 0x0080 /* check blocked waiting for output buffer allocation */
|
||||
#define CHK_ST_CLOSE_CONN 0x0100 /* check is waiting that the connection gets closed */
|
||||
#define CHK_ST_PURGE 0x0200 /* check must be freed */
|
||||
#define CHK_ST_SLEEPING 0x0400 /* check was sleeping */
|
||||
#define CHK_ST_SLEEPING 0x0400 /* check was sleeping, i.e. not currently bound to a thread */
|
||||
#define CHK_ST_FASTINTER 0x0800 /* force fastinter check */
|
||||
|
||||
/* check status */
|
||||
|
||||
@ -1754,7 +1754,7 @@ int init_srv_check(struct server *srv)
|
||||
ret |= ERR_ALERT | ERR_ABORT;
|
||||
goto out;
|
||||
}
|
||||
srv->check.state |= CHK_ST_CONFIGURED | CHK_ST_ENABLED;
|
||||
srv->check.state |= CHK_ST_CONFIGURED | CHK_ST_ENABLED | CHK_ST_SLEEPING;
|
||||
srv_take(srv);
|
||||
|
||||
/* Only increment maxsock for servers from the configuration. Dynamic
|
||||
@ -1817,7 +1817,7 @@ int init_srv_agent_check(struct server *srv)
|
||||
if (!srv->agent.inter)
|
||||
srv->agent.inter = srv->check.inter;
|
||||
|
||||
srv->agent.state |= CHK_ST_CONFIGURED | CHK_ST_ENABLED | CHK_ST_AGENT;
|
||||
srv->agent.state |= CHK_ST_CONFIGURED | CHK_ST_ENABLED | CHK_ST_SLEEPING | CHK_ST_AGENT;
|
||||
srv_take(srv);
|
||||
|
||||
/* Only increment maxsock for servers from the configuration. Dynamic
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user