[Mongrel] Nginx/Mongrel proxy_read_timeout issue

M. Hakan Aksu mha at axugroup.com
Wed Aug 15 07:58:57 EDT 2007


This may be a nginx issue more than a mongrel one but I though folks in this
list might be interested.
Anyway, I have a  mongrel_cluster with 2 front nginx workers as proxy.

I recently replaced apache/mod_proxy for nginx, and I wasn't aware of the 60
seconds default proxy_read_timeout so I went a head and tried to run a
process via http GET.  Normally because of the 60 seconds the GET I did from
the browser should have stopped but it kept running. Checking the database i
noticed that my process was running multiple times!. Looking at the nginx
error logs below, I noticed that nginx restarted the same call couple of
times on a different mongrel after each timeout. I had to kill the nginx
processes to stop it all.


2007/08/14 22:18:40 [error] 1720#0: *129 upstream timed out (110: Connection
timed out) while reading response header from upstream, client:
192.168.1.102, server: factory, URL: "/opening_balance/post", upstream: "
http://127.0.0.1:8013/opening_balance/post", host: "rs"
2007/08/14 22:19:40 [error] 1720#0: *129 upstream timed out (110: Connection
timed out) while reading response header from upstream, client:
192.168.1.102, server: factory, URL: "/opening_balance/post", upstream: "
http://127.0.0.1:8014/opening_balance/post ", host: "rs"
2007/08/14 22:20:40 [error] 1720#0: *129 upstream timed out (110: Connection
timed out) while reading response header from upstream, client:
192.168.1.102 , server: factory, URL: "/opening_balance/post", upstream: "
http://127.0.0.1:8015/opening_balance/post", host: "rs"
2007/08/14 22:21:40 [error] 1720#0: *129 upstream timed out (110: Connection
timed out) while reading response header from upstream, client:
192.168.1.102, server: factory, URL: "/opening_balance/post", upstream: "
http://127.0.0.1:8016/opening_balance/post ", host: "rs"
2007/08/14 22:22:40 [info] 1720#0: *129 client closed prematurely
connection, so upstream connection is closed too while sending request to
upstream, client: 192.168.1.102, server: factory, URL:
"/opening_balance/post", upstream: "
http://127.0.0.1:8017/opening_balance/post", host: "rs"


So here' my question: Is this normal? Shouldn't upstream connection be
closed after the timeout instead of re spawning the same call? I think this
may be a very dangerous behavior.

I'll appreciate to see your comments.

-Hakan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070815/faa8bb9e/attachment.html 


More information about the Mongrel-users mailing list