recevra seulement 10 connexions simultanées tant que le proxy sera sous les 1000
sessions.
+Il est possible de limiter la taille de la file d'attente dans le but de
+redistribuer les connexions destinées à un serveur en particulier qui sont trop
+loin pour avoir une chance d'être servies en un temps raisonnable. Ceci n'est
+acceptable que dans le cas où l'affinité entre le client et le serveur n'est
+pas obligatoire, mais motivée uniquement par des raisons de performances, par
+exemple, par l'utilisation d'un cache local au serveur. L'option 'maxqueue'
+permet de préciser la limite par serveur, tel que dans l'exemple ci-dessous :
+
+... (même exemple que précédemment)
+ server pentium3-800 192.168.1.1:80 cookie s1 weight 8 minconn 10 maxconn 100 check maxqueue 50
+ server opteron-2.0G 192.168.1.2:80 cookie s2 weight 20 minconn 30 maxconn 300 check maxqueue 200
+ server opteron-2.4G 192.168.1.3:80 cookie s3 weight 24 minconn 30 maxconn 300 check
+
+En l'absence du paramètre 'maxqueue', la file d'un serveur n'a pas de limite
+définie. Dans le cas contraire, lorsque la file atteint la limite fixée par
+'maxqueue', les clients sont déplacés vers la file globale.
+
Notes :
-------
- la requête ne restera pas indéfiniment en file d'attente, elle est
newsrv->fall = DEF_FALLTIME;
newsrv->health = newsrv->rise; /* up, but will fall down at first failure */
newsrv->uweight = 1;
+ newsrv->maxqueue = 0;
cur_arg = 3;
while (*args[cur_arg]) {
newsrv->maxconn = atol(args[cur_arg + 1]);
cur_arg += 2;
}
+ else if (!strcmp(args[cur_arg], "maxqueue")) {
+ newsrv->maxqueue = atol(args[cur_arg + 1]);
+ cur_arg += 2;
+ }
else if (!strcmp(args[cur_arg], "check")) {
global.maxsock++;
do_check = 1;
}
#endif
else {
- Alert("parsing [%s:%d] : server %s only supports options 'backup', 'cookie', 'check', 'inter', 'rise', 'fall', 'addr', 'port', 'source', 'minconn', 'maxconn' and 'weight'.\n",
+ Alert("parsing [%s:%d] : server %s only supports options 'backup', 'cookie', 'check', 'inter', 'rise', 'fall', 'addr', 'port', 'source', 'minconn', 'maxconn', 'maxqueue', and 'weight'.\n",
file, linenum, newsrv->id);
return -1;
}
"ereq,econ,eresp,"
"wretr,wredis,"
"status,weight,act,bck,"
- "chkfail,chkdown,lastchg,downtime,"
+ "chkfail,chkdown,lastchg,downtime,qlimit,"
"\n");
}
if (buffer_write_chunk(rep, &msg) != 0)
if (flags & STAT_FMT_HTML) {
/* print a new table */
chunk_printf(&msg, sizeof(trash),
- "<table cols=\"23\" class=\"tbl\" width=\"100%%\">\n"
+ "<table cols=\"24\" class=\"tbl\" width=\"100%%\">\n"
"<tr align=\"center\" class=\"titre\">"
"<th colspan=2 class=\"pxname\">%s</th>"
"<th colspan=21 class=\"empty\"></th>"
"</tr>\n"
"<tr align=\"center\" class=\"titre\">"
"<th rowspan=2></th>"
- "<th colspan=2>Queue</th><th colspan=4>Sessions</th>"
+ "<th colspan=3>Queue</th><th colspan=4>Sessions</th>"
"<th colspan=2>Bytes</th><th colspan=2>Denied</th>"
"<th colspan=3>Errors</th><th colspan=2>Warnings</th>"
"<th colspan=7>Server</th>"
"</tr>\n"
"<tr align=\"center\" class=\"titre\">"
- "<th>Cur</th><th>Max</th><th>Cur</th><th>Max</th>"
+ "<th>Cur</th><th>Max</th><th>Limit</th><th>Cur</th><th>Max</th>"
"<th>Limit</th><th>Cumul</th><th>In</th><th>Out</th>"
"<th>Req</th><th>Resp</th><th>Req</th><th>Conn</th>"
"<th>Resp</th><th>Retr</th><th>Redis</th>"
if (flags & STAT_FMT_HTML) {
chunk_printf(&msg, sizeof(trash),
/* name, queue */
- "<tr align=center class=\"frontend\"><td>Frontend</td><td colspan=2></td>"
+ "<tr align=center class=\"frontend\"><td>Frontend</td><td colspan=3></td>"
/* sessions : current, max, limit, cumul */
"<td align=right>%d</td><td align=right>%d</td>"
"<td align=right>%d</td><td align=right>%d</td>"
/* server status : reflect frontend status */
"%s,"
/* rest of server: nothing */
- ",,,,,,,"
+ ",,,,,,,,"
"\n",
px->id,
px->feconn, px->feconn_max, px->maxconn, px->cum_feconn,
chunk_printf(&msg, sizeof(trash),
/* name */
"<tr align=\"center\" class=\"%s%d\"><td>%s</td>"
- /* queue : current, max */
- "<td align=right>%d</td><td align=right>%d</td>"
+ /* queue : current, max, limit */
+ "<td align=right>%d</td><td align=right>%d</td><td align=right>%s</td>"
/* sessions : current, max, limit, cumul */
"<td align=right>%d</td><td align=right>%d</td>"
"<td align=right>%s</td><td align=right>%d</td>"
"",
(sv->state & SRV_BACKUP) ? "backup" : "active",
sv_state, sv->id,
- sv->nbpend, sv->nbpend_max,
- sv->cur_sess, sv->cur_sess_max, sv->maxconn ? ultoa(sv->maxconn) : "-", sv->cum_sess,
+ sv->nbpend, sv->nbpend_max, LIM2A0(sv->maxqueue, "-"),
+ sv->cur_sess, sv->cur_sess_max, LIM2A1(sv->maxconn, "-"), sv->cum_sess,
sv->bytes_in, sv->bytes_out,
sv->failed_secu,
sv->failed_conns, sv->failed_resp,
/* check failures: unique, fatal; last change, total downtime */
if (sv->state & SRV_CHECKED)
chunk_printf(&msg, sizeof(trash),
- "%d,%d,%d,%d,\n",
+ "%d,%d,%d,%d,",
sv->failed_checks, sv->down_trans,
now.tv_sec - sv->last_change, srv_downtime(sv));
else
chunk_printf(&msg, sizeof(trash),
- ",,,,\n");
+ ",,,,");
+
+ /* queue limit and EOL */
+ chunk_printf(&msg, sizeof(trash),
+ "%s,\n",
+ LIM2A0(sv->maxqueue, ""));
}
if (buffer_write_chunk(rep, &msg) != 0)
return 0;
/* name */
"<tr align=center class=\"backend\"><td>Backend</td>"
/* queue : current, max */
- "<td align=right>%d</td><td align=right>%d</td>"
+ "<td align=right>%d</td><td align=right>%d</td><td></td>"
/* sessions : current, max, limit, cumul. */
"<td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td>"
/* bytes : in, out */
"%d,%d,%d,"
/* rest of backend: nothing, down transformations,
* last change, total downtime. */
- ",%d,%d,%d,"
+ ",%d,%d,%d,,"
"\n",
px->id,
px->nbpend /* or px->totpend ? */, px->nbpend_max,