Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: =?ISO-8859-1?Q?G=E1bor_Farkas?= <gabor.farkas-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: proxy_next_upstream, only "connect" timeout?
Newsgroups: gmane.comp.web.nginx.english
Date: Wednesday 13th June 2012 12:09:32 UTC (over 5 years ago)
hi,

is there any way to tell nginx to fallback to the next upstream in
case of timeout,
but only if the timeout occured during connection (for example because
the upstream's backlog is full),
and not when the upstream is already processing the request? basically
the case specified by the proxy_connect_timeout.

it seems if i do:
"proxy_next_upstream timeout", then this can happen:

1. nginx sends the request to upstream1
2. upstream1 begins processing the request, stores data in the db, etc
3. while upstream1 creates the response, the timeout happens, and
nginx sends the request to upstream2
4. upstream2 begins processing the request, stores data in the db, etc

at this point the request was processed twice, data were written in
the database twice etc. i would like to avoid it.

but, on the other hand, if i say "proxy_next_upstream off", then this
can happen:

1. nginx sends the request to upstream1
2. upstream1's socket-backlog is full, so nginx returns a http504 to
the user, even if there is upstream2, that theoretically could have
served the request.

any ideas how to handle this situation?

thanks,
gabor
 
CD: 6ms