[upstream] consistent hash support backup?

洪志道 hongzhidao at gmail.com
Mon Nov 6 13:35:14 UTC 2017


We know that consistent hash upstream improve its selection in the latest

-        if (hp->tries >= points->number) {
pc->name = hp->rrp.peers->name;
<http://hg.nginx.org/nginx/rev/6c52b24fcf8e#l1.20>+        if
(hp->tries > 20) { <http://hg.nginx.org/nginx/rev/6c52b24fcf8e#l1.21>
<http://hg.nginx.org/nginx/rev/6c52b24fcf8e#l1.22>-            return
NGX_BUSY; <http://hg.nginx.org/nginx/rev/6c52b24fcf8e#l1.23>+
  return hp->get_rr_peer(pc, &hp->rrp);

Does it mean that "backup" option is allowed in the module?

+                  |NGX_HTTP_UPSTREAM_BACKUP

I wonder how to archive the effect of "backup" in hash like round robin,

even if we don't want to use error_page.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20171106/1c1a616e/attachment.html>

More information about the nginx-devel mailing list