# Work-around for upstream\_fair bug?

**URL:** <https://www.ruby-forum.com/t/work-around-for-upstream-fair-bug/185350>\
**Category:** NGINX\
**Created:** [March 18, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/work-around-for-upstream-fair-bug/185350 "2010-03-18T15:31:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![russellneufeld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@russellneufeld](https://www.ruby-forum.com/u/russellneufeld)\
**Post date:** [March 18, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/work-around-for-upstream-fair-bug/185350/1 "2010-03-18T15:31:39Z")

</div>

Hi all,

We have nginx set up to reverse proxy to a couple of apache instances.  
Every so often apache takes longer than 60 seconds to respond, and then  
nginx pulls that server out of rotation and does not add it back in. We  
are using the upstream\_fair plugin, as it does a nicer job of round  
robining, however we are clearly running into this bug:

“Upstream servers are not reintroduced to the pool after becoming  
available”  
[http://nginx.localdomain.pl/ticket/3](http://nginx.localdomain.pl/ticket/3)

This bug has been open for 16 months. Doesn’t seem like it’s going to  
get fixed any time soon. Are there any known workarounds? I tried  
bumping up max\_fails from the default of one, however that didn’t seem  
to help - any single slow response from apache pulls that server out of  
rotation. Here is the relevant section of our nginx.conf:

upstream [www.foo.com](http://www.foo.com) {  
server public-web1:8000 weight=2 max\_fails=2;  
server public-web2:8000 weight=3 max\_fails=2;  
fair;  
}

Any suggestions? Thanks in advance,

```
Russ

```

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,65269,65269#msg-65269](http://forum.nginx.org/read.php?2,65269,65269#msg-65269)

---

<div class="post-metadata">

**Author:** ![russellneufeld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@russellneufeld](https://www.ruby-forum.com/u/russellneufeld)\
**Post date:** [March 18, 2010, 5:05pm UTC](https://www.ruby-forum.com/t/work-around-for-upstream-fair-bug/185350/2 "2010-03-18T17:05:56Z")

</div>

On Thu, Mar 18, 2010 at 10:30:57AM -0400, russellneufeld wrote:

> ```
> server public-web1:8000 weight=2 max_fails=2;
> server public-web2:8000 weight=3 max_fails=2;
> fair;
> 
> ```
> 
> }
> 
> Any suggestions? Thanks in advance,

Hi,

Indeed I haven’t got a suitable round tuit to fix this. I hope I’ll be  
able to spend some time on upstream-fair in the upcoming weeks, so not  
all is lost yet 🙂

Best regards,  
Grzegorz N.

---

<div class="post-metadata">

**Author:** ![russellneufeld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@russellneufeld](https://www.ruby-forum.com/u/russellneufeld)\
**Post date:** [March 18, 2010, 6:05pm UTC](https://www.ruby-forum.com/t/work-around-for-upstream-fair-bug/185350/3 "2010-03-18T18:05:03Z")

</div>

Hi Grzegorz,

Thanks for the reply. Do you know of a way I can detect this state?  
We are using both nagios and munin to monitor our website. If I can get  
an alert when one of the servers has been taken out of rotation that  
would be really helpful in the interim.

Thanks,

```
Russ

```

Posted at Nginx Forum:

> **[Re: Work-around for upstream\_fair bug?](https://forum.nginx.org/read.php?2,65269,65324#msg-65324)**
>
> Hi all, We have nginx set up to reverse proxy to a couple of apache instances. Every so often apache takes longer than 60 seconds to respond, and then nginx pulls that server out of rotation and does not add it back in. We are using the upstream\_fair...
