# Issue with nginx not waiting for a response from mongrel

**URL:** <https://www.ruby-forum.com/t/issue-with-nginx-not-waiting-for-a-response-from-mongrel/144688>\
**Category:** NGINX\
**Created:** [August 1, 2008, 7:56am UTC](https://www.ruby-forum.com/t/issue-with-nginx-not-waiting-for-a-response-from-mongrel/144688 "2008-08-01T07:56:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rupert\_Fiasco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@Rupert\_Fiasco](https://www.ruby-forum.com/u/Rupert_Fiasco)\
**Post date:** [August 1, 2008, 7:56am UTC](https://www.ruby-forum.com/t/issue-with-nginx-not-waiting-for-a-response-from-mongrel/144688/1 "2008-08-01T07:56:12Z")

</div>

This might be more of a mongrel issue, not sure where the problem lies.

We are proxying mongrels behind an instance of nginx 0.6.29 and are  
seeing situations where nginx passes off a request to a mongrel but  
then doesnt wait for a response. Note it is not timing out, we are  
logging the upstream response time and all of these cases are less  
than the default 60s proxy\_read\_timeout value.

In a possibly related issue, nginx will continue to send requests to a  
busy mongrel (which I think just queues them?). By analyzing the Rails  
log and matching it up with the nginx access log with upstream timing  
we can see that nginx is issuing multiple requests to a mongrel when  
clearly its busy. Ultimately this will result in a long running  
process and then seemingly nginx getting confused.

All of the proxy\_read, connect timeout values are not specified - so  
the defaults are being used.

Thanks  
-Rupert

---

<div class="post-metadata">

**Author:** ![Rupert\_Fiasco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@Rupert\_Fiasco](https://www.ruby-forum.com/u/Rupert_Fiasco)\
**Post date:** [August 2, 2008, 12:02am UTC](https://www.ruby-forum.com/t/issue-with-nginx-not-waiting-for-a-response-from-mongrel/144688/2 "2008-08-02T00:02:23Z")

</div>

By default, nginx proxying is just round-robin. The fair proxy  
balancer will try to avoid overloading your mongrels.

[http://wiki.codemongers.com/NginxHttpUpstreamFairModule](http://wiki.codemongers.com/NginxHttpUpstreamFairModule)

---

<div class="post-metadata">

**Author:** ![Rupert\_Fiasco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@Rupert\_Fiasco](https://www.ruby-forum.com/u/Rupert_Fiasco)\
**Post date:** [August 7, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/issue-with-nginx-not-waiting-for-a-response-from-mongrel/144688/3 "2008-08-07T19:44:31Z")

</div>

W. andrew Loe iii wrote:

> By default, nginx proxying is just round-robin. The fair proxy  
> balancer will try to avoid overloading your mongrels.
> 
> [http://wiki.codemongers.com/NginxHttpUpstreamFairModule](http://wiki.codemongers.com/NginxHttpUpstreamFairModule)

I think he wants a feature like a per-server max connection (as  
haproxy). This transforms server into a request buffer between the  
thousands of  
clients and the few backend servers.
