multi server addresses appear in variable $upstream_addr which was not supposed to

B.R. reallfqq-nginx at yahoo.fr
Sun Aug 28 17:53:13 UTC 2016


The docs say multiple servers might be contacted: $upstream_addr
<http://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_addr>
Upstream groups are used to tolerate errors on some responses (and replay
the request somewhere else): upstream
<http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream>
---
*B. R.*

On Sun, Aug 28, 2016 at 3:47 PM, 褚夫元 <chufuyuan at live.cn> wrote:

> Hello!
>
>     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 ?
>
>     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
> ?
>
>     *More important is how to find the "spirit" behind this weird problem
> and fix it.*
>
>     Thanks a lot ! !
>
>     Nginx Version: nginx/1.6.2
>     OS:  CentOS release 6.5 (Final) x86_64
>
>     Here is access log below:
>
> client_ip      26/Aug/2016:15:45:06 +0800      GET     host_ip       80
>    *10.10.10.10:8080 <http://10.10.10.10:8080>, backendservice *
> /backend/api/v1.0/bowner/1123223      HTTP/1.1        502     551     -
>     UA:Java/1.8.0_60        -       0.139   0.139, 0.000
>
> client_ip      26/Aug/2016:15:45:12 +0800      GET     host_ip       80
>    *10.10.10.10:8080 <http://10.10.10.10:8080>, backendservice*
>   /backend/api/v1.0/bowner/1123822      HTTP/1.1        502     551     -
>       UA:Java/1.8.0_60        -       0.070   0.070, 0.000
>
> client_ip      26/Aug/2016:15:45:17 +0800      POST    host_ip       80
>    *10.10.10.10:8080 <http://10.10.10.10:8080>, 10.10.10.11:8080
> <http://10.10.10.11:8080>*        /backend/api/v1.0/bowner/1133782
>        HTTP/1.1        200     129     -       UA:Java/1.8.0_60        -
>     0.124   0.043, 0.081
>
>
> * Backend API  /backend/api/v1.0/bowner/{request_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.
>
> Here is upstream configuration:
>
>
> upstream *backendservice* {
>         server *10.10.10.10:8080 <http://10.10.10.10:8080>*weight=15;
>         server *10.10.10.11:8080 <http://10.10.10.11:8080>* weight=13;
> }
>
>
>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160828/ab906431/attachment.html>


More information about the nginx mailing list