mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-27 23:22:09 +00:00
OPTIM: backend/random: never queue on the server, always on the backend
If random() returns a server whose maxconn is reached or the queue is used, instead of adding the request to the server's queue, better add it to the backend queue so that it can be served by any server (hence the fastest one).
This commit is contained in:
parent
9d85eb02d5
commit
b88ae18021
@ -548,6 +548,13 @@ static struct server *get_server_rnd(struct stream *s, const struct server *avoi
|
||||
curr = prev;
|
||||
} while (--draws > 0);
|
||||
|
||||
/* if the selected server is full, pretend we have none so that we reach
|
||||
* the backend's queue instead.
|
||||
*/
|
||||
if (curr &&
|
||||
(curr->nbpend || (curr->maxconn && curr->served >= srv_dynamic_maxconn(curr))))
|
||||
curr = NULL;
|
||||
|
||||
return curr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user