POST timeouts with rails

Igor Clark igor at pokelondon.com
Wed May 21 17:39:39 MSD 2008


Hi there

Just trying a naïve configuration to get things started on a new app,  
I'm having problems.

> upstream dev_mongrels {	# all work fine, tested directly
>     server  127.0.0.1:10000;
>     server  127.0.0.1:10001;
>     server  127.0.0.1:10002;
>     server  127.0.0.1:10003;
> }
>
> server {
>
>    [...]
>
>     location / {
>         rewrite ^/$ /flash/index redirect;
>         error_page  404 =   @mongrels;
>     }
>
>     location @mongrels {
>         proxy_pass  http://dev_mongrels;
>     }
> }

GET /gateway works as expected:

> 192.168.24.121 - - [21/May/2008:12:50:13 +0100] "GET /gateway HTTP/ 
> 1.1" 200 421 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2;  
> en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/ 
> 525.18" "-"

POST /gateway fails

> 2008/05/21 12:51:00 [error] 2060#0: *11 upstream timed out (110:  
> Connection timed out) while reading response header from upstream,  
> client: 192.168.24.121, server: dev.server.name, request: "POST / 
> gateway HTTP/1.1", upstream: "http://127.0.0.1:10000/gateway", host:  
> "dev.server.name", referrer: "http://dev.server.name/flash/main.swf"

Debug log:

> 2008/05/21 14:34:15 [debug] 8811#0: *28 http cleanup add: 09D38178
> 2008/05/21 14:34:15 [debug] 8811#0: *28 get rr peer, try: 4
> 2008/05/21 14:34:15 [debug] 8811#0: *28 get rr peer, current: 2 1
> 2008/05/21 14:34:15 [debug] 8811#0: *28 socket 13
> 2008/05/21 14:34:15 [debug] 8811#0: *28 epoll add connection: fd:13  
> ev:80000005
> 2008/05/21 14:34:15 [debug] 8811#0: *28 connect to 127.0.0.1:10002,  
> fd:13 #29
> 2008/05/21 14:34:15 [debug] 8811#0: *28 http upstream connect: -2
> 2008/05/21 14:34:15 [debug] 8811#0: *28 event timer add: 13:  
> 60000:196138193
> 2008/05/21 14:34:15 [debug] 8811#0: *28 post event 09D77EF0
> 2008/05/21 14:34:15 [debug] 8811#0: *28 post event 09D77EBC
> 2008/05/21 14:34:15 [debug] 8811#0: *28 delete posted event 09D77EBC
> 2008/05/21 14:34:15 [debug] 8811#0: *28 http upstream check client,  
> write event:1, "/gateway"
> 2008/05/21 14:34:15 [debug] 8811#0: *28 http upstream recv(): -1  
> (11: Resource temporarily unavailable)
> 2008/05/21 14:34:15 [debug] 8811#0: *28 delete posted event 09D77EF0
> 2008/05/21 14:34:15 [debug] 8811#0: *28 http upstream send request  
> handler
> 2008/05/21 14:34:15 [debug] 8811#0: *28 http upstream send request
> 2008/05/21 14:34:15 [debug] 8811#0: *28 chain writer buf fl:1 s:550
> 2008/05/21 14:34:15 [debug] 8811#0: *28 chain writer in: 09D38194
> 2008/05/21 14:34:15 [debug] 8811#0: *28 writev: 550
> 2008/05/21 14:34:15 [debug] 8811#0: *28 chain writer out: 00000000
> 2008/05/21 14:34:15 [debug] 8811#0: *28 event timer del: 13: 196138193
> 2008/05/21 14:34:15 [debug] 8811#0: *28 event timer add: 13:  
> 60000:196138194
> 2008/05/21 14:34:17 [debug] 8811#0: *27 event timer del: 11: 196080177
> 2008/05/21 14:34:17 [debug] 8811#0: *27 http keepalive handler
> 2008/05/21 14:34:17 [debug] 8811#0: *27 close http connection: 11
> 2008/05/21 14:34:17 [debug] 8811#0: *27 free: 09D3AF38
> 2008/05/21 14:34:17 [debug] 8811#0: *27 free: 00000000
> 2008/05/21 14:34:17 [debug] 8811#0: *27 free: 00000000
> 2008/05/21 14:34:17 [debug] 8811#0: *27 free: 09D31690, unused: 56

POST /gateway directly to 127.0.0.1:1000(0|1|2|3) works as expected,  
does not time out, does not have connection issues.

Linux 2.6.18-53.1.19.el5PAE
Configuration:

> ./configure
> --prefix=/poke/software/install/nginx-0.6.31
> --conf-path=/poke/software/install/nginx-0.6.31/conf/nginx.conf
> --with-http_stub_status_module
> --with-http_flv_module
> --with-pcre=../pcre-7.7
> --with-debug
> --user=nginx

Same result with and without debug.

Does anyone here use named locations for POSTing anything?

I really want to use it because it seems like such a significantly  
more elegant mannerism but I just can't get it going with POSTs,  
neither with various PHP apps in the past, nor now with Rails.

Any ideas would be very welcome.

Cheers
Igor

--
Igor Clark • POKE • 10 Redchurch Street • E2 7DD • +44 (0)20 7749 5355  
• www.pokelondon.com








More information about the nginx mailing list