<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">The docs say multiple servers might be contacted: <a href="http://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_addr" target="_blank">$upstream_addr</a><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Upstream groups are used to tolerate errors on some responses (and replay the request somewhere else): <a href="http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream" target="_blank">upstream</a><br></div><div class="gmail_extra"><div><div data-smartmail="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Sun, Aug 28, 2016 at 3:47 PM, 褚夫元 <span dir="ltr"><<a href="mailto:chufuyuan@live.cn" target="_blank">chufuyuan@live.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:18px;font-family:STFangsong,sans-serif"><div>Hello!</div><div><br></div><div>    It is pretty strange that there was two upstream servers in $upstream_addr. It seems two servers received request and both had a respose. Client received the response which took less duration time, I guess.  Am I right ?</div><div><br></div><div>    What is stranger is  the name of upstream server group appears in $upstream_addr. I don't know the consequence in such situation. Any explain ?</div><div><br></div><div>    *More important is how to find the "spirit" behind this weird problem and fix it.* </div><div><br></div><div>    Thanks a lot ! !</div><div><br></div><div>    Nginx Version: nginx/1.6.2</div><div>    OS:  CentOS release 6.5 (Final) x86_64</div><div><br></div><div>    Here is access log below:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>client_ip      26/Aug/2016:15:45:06 +0800      GET     host_ip       80      <i><a href="http://10.10.10.10:8080" target="_blank">10.10.10.10:8080</a>, backendservice </i>      /backend/api/v1.0/bowner/11232<wbr>23      HTTP/1.1        502     551     -       UA:Java/1.8.0_60        -       0.139   0.139, 0.000</div><div><br></div><div>client_ip      26/Aug/2016:15:45:12 +0800      GET     host_ip       80      <i><a href="http://10.10.10.10:8080" target="_blank">10.10.10.10:8080</a>, backendserv<wbr>ice</i>       /backend/api/v1.0/bowner/112<wbr>3822      HTTP/1.1        502     551     -       UA:Java/1.8.0_60        -       0.070   0.070, 0.000</div><div><br></div><div>client_ip      26/Aug/2016:15:45:17 +0800      POST    host_ip       80      <i><a href="http://10.10.10.10:8080" target="_blank">10.10.10.10:8080</a>, <a href="http://10.10.10.11:8080" target="_blank">10.10.10.11:8080</a></i>        /backend/api/v1.0/bowner/1133<wbr>782</div><div>       HTTP/1.1        200     129     -       UA:Java/1.8.0_60        -       0.124   0.043, 0.081</div><div><br></div><div><br></div><div><div>* Backend API  /backend/api/v1.0/bowner/{req<wbr>uest_id} is supposed to be processed by one server. One server will be return 500 code if many backend servers received same request at (almost) same time.</div></div><div><br></div></blockquote><div>Here is upstream configuration:</div><div> </div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>upstream <i>backendservice</i> {</div><div>        server <i><a href="http://10.10.10.10:8080" target="_blank">10.10.10.10:8080</a></i>weight=<wbr>15;</div><div>        server <i><a href="http://10.10.10.11:8080" target="_blank">10.10.10.11:8080</a></i> weight<wbr>=13;</div><div>}</div><div><br></div><div><br></div></blockquote></div><div><br></div><div><br></div><div><div></div></div></div>
<br>______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailm<wbr>an/listinfo/nginx</a><br></blockquote></div><br></div></div>