mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
[MINOR] add warnings on features not compatible with multi-process mode
Using haproxy in multi-process mode (nbproc > 1), some features can be not fully compatible or not work at all. haproxy will now display a warning on startup for : - appsession - sticking rules - stats / stats admin - stats socket - peers (fatal error in that case)
This commit is contained in:
parent
535aae4817
commit
02ff8ef677
@ -1142,11 +1142,15 @@ appsession <cookie> len <length> timeout <holdtime>
|
|||||||
|
|
||||||
The definition of an application cookie is limited to one per backend.
|
The definition of an application cookie is limited to one per backend.
|
||||||
|
|
||||||
|
Note : Consider not using this feature in multi-process mode (nbproc > 1)
|
||||||
|
unless you know what you do : memory is not shared between the
|
||||||
|
processes, which can result in random behaviours.
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
appsession JSESSIONID len 52 timeout 3h
|
appsession JSESSIONID len 52 timeout 3h
|
||||||
|
|
||||||
See also : "cookie", "capture cookie", "balance", "stick", "stick-table"
|
See also : "cookie", "capture cookie", "balance", "stick", "stick-table",
|
||||||
and "ignore-persist"
|
"ignore-persist", "nbproc" and "bind-process".
|
||||||
|
|
||||||
|
|
||||||
backlog <conns>
|
backlog <conns>
|
||||||
@ -4813,6 +4817,10 @@ stats admin { if | unless } <cond>
|
|||||||
The admin level allows to enable/disable servers from the web interface. By
|
The admin level allows to enable/disable servers from the web interface. By
|
||||||
default, statistics page is read-only for security reasons.
|
default, statistics page is read-only for security reasons.
|
||||||
|
|
||||||
|
Note : Consider not using this feature in multi-process mode (nbproc > 1)
|
||||||
|
unless you know what you do : memory is not shared between the
|
||||||
|
processes, which can result in random behaviours.
|
||||||
|
|
||||||
Currently, there are 2 known limitations :
|
Currently, there are 2 known limitations :
|
||||||
|
|
||||||
- The POST data are limited to one packet, which means that if the list of
|
- The POST data are limited to one packet, which means that if the list of
|
||||||
@ -4849,8 +4857,9 @@ stats admin { if | unless } <cond>
|
|||||||
stats http-request auth unless AUTH
|
stats http-request auth unless AUTH
|
||||||
stats admin if AUTH_ADMIN
|
stats admin if AUTH_ADMIN
|
||||||
|
|
||||||
See also : "stats enable", "stats auth", "stats http-request", section 3.4
|
See also : "stats enable", "stats auth", "stats http-request", "nbproc",
|
||||||
about userlists and section 7 about ACL usage.
|
"bind-process", section 3.4 about userlists and section 7 about
|
||||||
|
ACL usage.
|
||||||
|
|
||||||
|
|
||||||
stats auth <user>:<passwd>
|
stats auth <user>:<passwd>
|
||||||
@ -5291,6 +5300,10 @@ stick match <pattern> [table <table>] [{if | unless} <cond>]
|
|||||||
way, it becomes very easy to insert cookies and match on IP addresses in
|
way, it becomes very easy to insert cookies and match on IP addresses in
|
||||||
order to maintain stickiness between HTTP and HTTPS.
|
order to maintain stickiness between HTTP and HTTPS.
|
||||||
|
|
||||||
|
Note : Consider not using this feature in multi-process mode (nbproc > 1)
|
||||||
|
unless you know what you do : memory is not shared between the
|
||||||
|
processes, which can result in random behaviours.
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
# forward SMTP users to the same server they just used for POP in the
|
# forward SMTP users to the same server they just used for POP in the
|
||||||
# last 30 minutes
|
# last 30 minutes
|
||||||
@ -5309,8 +5322,8 @@ stick match <pattern> [table <table>] [{if | unless} <cond>]
|
|||||||
server s1 192.168.1.1:25
|
server s1 192.168.1.1:25
|
||||||
server s2 192.168.1.1:25
|
server s2 192.168.1.1:25
|
||||||
|
|
||||||
See also : "stick-table", "stick on", and section 7 about ACLs and pattern
|
See also : "stick-table", "stick on", "nbproc", "bind-process" and section 7
|
||||||
extraction.
|
about ACLs and pattern extraction.
|
||||||
|
|
||||||
|
|
||||||
stick on <pattern> [table <table>] [{if | unless} <condition>]
|
stick on <pattern> [table <table>] [{if | unless} <condition>]
|
||||||
@ -5323,6 +5336,10 @@ stick on <pattern> [table <table>] [{if | unless} <condition>]
|
|||||||
to both keywords for details. It is only provided as a convenience
|
to both keywords for details. It is only provided as a convenience
|
||||||
for writing more maintainable configurations.
|
for writing more maintainable configurations.
|
||||||
|
|
||||||
|
Note : Consider not using this feature in multi-process mode (nbproc > 1)
|
||||||
|
unless you know what you do : memory is not shared between the
|
||||||
|
processes, which can result in random behaviours.
|
||||||
|
|
||||||
Examples :
|
Examples :
|
||||||
# The following form ...
|
# The following form ...
|
||||||
stick on src table pop if !localhost
|
stick on src table pop if !localhost
|
||||||
@ -5350,7 +5367,7 @@ stick on <pattern> [table <table>] [{if | unless} <condition>]
|
|||||||
server s1 192.168.1.1:443
|
server s1 192.168.1.1:443
|
||||||
server s2 192.168.1.1:443
|
server s2 192.168.1.1:443
|
||||||
|
|
||||||
See also : "stick match" and "stick store-request"
|
See also : "stick match", "stick store-request", "nbproc" and "bind-process".
|
||||||
|
|
||||||
|
|
||||||
stick store-request <pattern> [table <table>] [{if | unless} <condition>]
|
stick store-request <pattern> [table <table>] [{if | unless} <condition>]
|
||||||
@ -5411,6 +5428,10 @@ stick store-request <pattern> [table <table>] [{if | unless} <condition>]
|
|||||||
established, so that the table will contain the real server that processed
|
established, so that the table will contain the real server that processed
|
||||||
the request.
|
the request.
|
||||||
|
|
||||||
|
Note : Consider not using this feature in multi-process mode (nbproc > 1)
|
||||||
|
unless you know what you do : memory is not shared between the
|
||||||
|
processes, which can result in random behaviours.
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
# forward SMTP users to the same server they just used for POP in the
|
# forward SMTP users to the same server they just used for POP in the
|
||||||
# last 30 minutes
|
# last 30 minutes
|
||||||
@ -5429,8 +5450,8 @@ stick store-request <pattern> [table <table>] [{if | unless} <condition>]
|
|||||||
server s1 192.168.1.1:25
|
server s1 192.168.1.1:25
|
||||||
server s2 192.168.1.1:25
|
server s2 192.168.1.1:25
|
||||||
|
|
||||||
See also : "stick-table", "stick on", and section 7 about ACLs and pattern
|
See also : "stick-table", "stick on", "nbproc", "bind-process" and section 7
|
||||||
extraction.
|
about ACLs and pattern extraction.
|
||||||
|
|
||||||
|
|
||||||
stick-table type {ip | integer | string [len <length>] | binary [len <length>]}
|
stick-table type {ip | integer | string [len <length>] | binary [len <length>]}
|
||||||
@ -5494,6 +5515,8 @@ stick-table type {ip | integer | string [len <length>] | binary [len <length>]}
|
|||||||
automatically learned from the local peer (old process) during a
|
automatically learned from the local peer (old process) during a
|
||||||
soft restart.
|
soft restart.
|
||||||
|
|
||||||
|
NOTE : peers can't be used in multi-process mode.
|
||||||
|
|
||||||
<expire> defines the maximum duration of an entry in the table since it
|
<expire> defines the maximum duration of an entry in the table since it
|
||||||
was last created, refreshed or matched. The expiration delay is
|
was last created, refreshed or matched. The expiration delay is
|
||||||
defined using the standard time format, similarly as the various
|
defined using the standard time format, similarly as the various
|
||||||
|
@ -6261,9 +6261,54 @@ out_uri_auth_compat:
|
|||||||
listener = listener->next;
|
listener = listener->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check multi-process mode compatibility for the current proxy */
|
||||||
|
if (global.nbproc > 1) {
|
||||||
|
int nbproc = 0;
|
||||||
|
if (curproxy->bind_proc) {
|
||||||
|
int proc;
|
||||||
|
for (proc = 0; proc < global.nbproc; proc++) {
|
||||||
|
if (curproxy->bind_proc & (1 << proc)) {
|
||||||
|
nbproc++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
nbproc = global.nbproc;
|
||||||
|
}
|
||||||
|
if (curproxy->table.peers.name) {
|
||||||
|
Alert("Proxy '%s': peers can't be used in multi-process mode (nbproc > 1).\n",
|
||||||
|
curproxy->id);
|
||||||
|
cfgerr++;
|
||||||
|
}
|
||||||
|
if (nbproc > 1) {
|
||||||
|
if (curproxy->uri_auth) {
|
||||||
|
Warning("Proxy '%s': in multi-process mode, stats will be limited to process assigned to the current request.\n",
|
||||||
|
curproxy->id);
|
||||||
|
if (!LIST_ISEMPTY(&curproxy->uri_auth->admin_rules)) {
|
||||||
|
Warning("Proxy '%s': stats admin will not work correctly in multi-process mode.\n",
|
||||||
|
curproxy->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (curproxy->appsession_name) {
|
||||||
|
Warning("Proxy '%s': appsession will not work correctly in multi-process mode.\n",
|
||||||
|
curproxy->id);
|
||||||
|
}
|
||||||
|
if (!LIST_ISEMPTY(&curproxy->sticking_rules)) {
|
||||||
|
Warning("Proxy '%s': sticking rules will not work correctly in multi-process mode.\n",
|
||||||
|
curproxy->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
curproxy = curproxy->next;
|
curproxy = curproxy->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check multi-process mode compatibility */
|
||||||
|
if (global.nbproc > 1) {
|
||||||
|
if (global.stats_fe) {
|
||||||
|
Warning("stats socket will not work correctly in multi-process mode (nbproc > 1).\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (curuserlist = userlist; curuserlist; curuserlist = curuserlist->next) {
|
for (curuserlist = userlist; curuserlist; curuserlist = curuserlist->next) {
|
||||||
struct auth_users *curuser;
|
struct auth_users *curuser;
|
||||||
int g;
|
int g;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user