Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
* Slow response with HTTP 1.1?
@ 2014-07-04 15:18 Damian Janowski
  2014-07-04 19:50 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Damian Janowski @ 2014-07-04 15:18 UTC (permalink / raw)
  To: rainbows-public

Hi,

I'm seeing very slow (or time outs, depending on the client) for
requests made over HTTP 1.1. If I force curl to use HTTP 1.0,
everything works quickly.

The behavior is consistent over curl or when using Rainbows behind Varnish.

Any ideas?

$ uname -a
Linux ip-10-187-40-71 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u2
x86_64 GNU/Linux

$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]

$ rainbows -v
Rainbows! v4.6.2

$ time curl localhost:8080/ping -vv
* About to connect() to localhost port 8080 (#0)
*   Trying ::1...
* Connection refused
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /ping HTTP/1.1
> User-Agent: 'Mozilla/5.0'
> Host: localhost:8080
> Accept: */*
>
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Date: Fri, 04 Jul 2014 15:02:47 GMT
< Status: 200 OK
< Content-Type: text/plain; charset=UTF-8
< Connection: keep-alive
* no chunk, no close, no size. Assume close to signal end
<
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* nread <= 0, server closed connection, bailing
* Closing connection #0
PONG
real    0m5.015s
user    0m0.000s
sys     0m0.008s

$ time curl localhost:8080/ping -vv -0
* About to connect() to localhost port 8080 (#0)
*   Trying ::1...
* Connection refused
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /ping HTTP/1.0
> User-Agent: 'Mozilla/5.0'
> Host: localhost:8080
> Accept: */*
>
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Date: Fri, 04 Jul 2014 15:04:48 GMT
< Status: 200 OK
< Content-Type: text/plain; charset=UTF-8
< Connection: close
<
* nread <= 0, server closed connection, bailing
* Closing connection #0
PONG
real    0m0.010s
user    0m0.012s
sys     0m0.000s

^ permalink raw reply	[flat|threaded] 3+ messages in thread

* Re: Slow response with HTTP 1.1?
  2014-07-04 15:18 Slow response with HTTP 1.1? Damian Janowski
@ 2014-07-04 19:50 ` Eric Wong
  2014-07-06 17:02   ` Damian Janowski
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2014-07-04 19:50 UTC (permalink / raw)
  To: Damian Janowski; +Cc: rainbows-public

Damian Janowski <jano@dimaion.com> wrote:
> Hi,
> 
> I'm seeing very slow (or time outs, depending on the client) for
> requests made over HTTP 1.1. If I force curl to use HTTP 1.0,
> everything works quickly.
> 
> The behavior is consistent over curl or when using Rainbows behind Varnish.
> 
> Any ideas?

<snip>

> $ time curl localhost:8080/ping -vv

<snip>

> * HTTP 1.1 or later with persistent connection, pipelining supported
> < HTTP/1.1 200 OK
> < Date: Fri, 04 Jul 2014 15:02:47 GMT
> < Status: 200 OK
> < Content-Type: text/plain; charset=UTF-8
> < Connection: keep-alive
> * no chunk, no close, no size. Assume close to signal end

Your app is missing the Rack::ContentLength (and Rack::Chunked)
middlewares.  This is mentioned at the bottom of the manpage[1],
but I suspect it might be necessary to add a FAQ entry.

[1] http://rainbows.bogomips.org/rainbows.1.html

^ permalink raw reply	[flat|threaded] 3+ messages in thread

* Re: Slow response with HTTP 1.1?
  2014-07-04 19:50 ` Eric Wong
@ 2014-07-06 17:02   ` Damian Janowski
  0 siblings, 0 replies; 3+ messages in thread
From: Damian Janowski @ 2014-07-06 17:02 UTC (permalink / raw)
  To: Eric Wong; +Cc: rainbows-public

On Fri, Jul 4, 2014 at 4:50 PM, Eric Wong <e@80x24.org> wrote:
> Your app is missing the Rack::ContentLength (and Rack::Chunked)
> middlewares.  This is mentioned at the bottom of the manpage[1],
> but I suspect it might be necessary to add a FAQ entry.

:-O

Thank you.

^ permalink raw reply	[flat|threaded] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-04 15:18 Slow response with HTTP 1.1? Damian Janowski
2014-07-04 19:50 ` Eric Wong
2014-07-06 17:02   ` Damian Janowski

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror http://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox