Welcome! Log In Create A New Profile

Advanced

Re: Feature I'd like to see

xgdlm
June 04, 2010 11:26AM
Hello

Le 4 juin 2010 à 16:30, Almir Karic a écrit :

> The same "problem" that you are describing can be solved with say
> http://wiki.nginx.org/NginxHttpProxyModule#proxy_next_upstream while
> keeping one upstream block.

In my case if I setup a single upstream like this for instance :

upstream guinicorn {
server 192.168.0.171 max_fails=1 fail_timeout=10s;
server 192.168.0.172 max_fails=1 fail_timeout=10s;
server 192.168.0.173 max_fails=1 fail_timeout=10s;
server 192.168.0.174 max_fails=1 fail_timeout=10s;
server 192.168.0.175 max_fails=1 fail_timeout=10s;
server 127.0.0.1 backup;
}

and then I use it for multiple app

------------------------------------
server {
location / {
proxy_pass http://gunicorn:3000;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_504;
}
}

server {
location / {
proxy_pass http://gunicorn:3001;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_504;
}
}

server {
location / {
proxy_pass http://gunicorn:3002;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_504;
}
}
------------------------------------

if one of this app fails badly in five request all the upstream servers are set inoperative.
The behavior I noticed (few years ago, may be this has changed) is that all the app
using this upstream will be using the backup server. So if one app fails, the other fails to.

May be this behavior has changed, but now I create an upstream for each app and I never had the problem again.


xav


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Feature I'd like to see

xgdlm June 03, 2010 07:32PM

Re: Feature I'd like to see

Almir Karic June 04, 2010 10:36AM

Re: Feature I'd like to see

xgdlm June 04, 2010 11:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 142
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready