Rails 有在生产环境开启 http streaming 的没?

hooopo · November 10, 2011 · Last by huacnlee replied at February 04, 2012 · 3382 hits

RT

@hooopo 一直还没太注意用这个功能,我现在试试

已经开启了

nginx+unicorn? 你测试过效果没有。如果用 nginx 做反向代理的时候 nginx 和 unicorn 通讯使用的 http1.0 协议。对于一个 http1.0 的请求 unicorn 是不会使用 chunked 编码的。

#3 楼 @hooopo 稍等,刚刚调了 Unicorn,还在搞无缝重启的问题

测试了好多方式,线上环境依然还是没有,就算我是跳过反向代理,直接请求绑定在盛大云的地址也是不行, @hooopo 知道该如何配置么?

可能是盛大云使用了反向代理吧 我在 heroku 试过是可以的: curl -i http://rails3demo.herokuapp.com/articles https://github.com/hooopo/rails3demo

#6 楼 @hooopo 刚才调整了一下,现在有了,反向代理的也有

$ curl -i http://ruby-china.org/topics            
HTTP/1.1 200 OK
Server: nginx/1.1.6
Date: Sat, 19 Nov 2011 15:49:25 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200 OK
X-UA-Compatible: IE=Edge,chrome=1
ETag: "4a7b928194df0740e1f6732028082462"
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: _homeland_session=....
X-Runtime: 0.348755
X-Rack-Cache: miss

两个都有也不能说明使用了 http streaming。你还得看一下 app server 的日志。如果反向代理和 app server 之间通讯使用的是 http1.0 协议还是不行的。

#8 楼 @hooopo 两个都是 http 1.1 的

咦 为啥我的就是 http1.0 的 你什么版本的 nginx 呀

http://wiki.nginx.org/HttpProxyModule

It is an HTTP/1.0 proxy without the ability for keep-alive requests yet. (As a result, backend connections are created and destroyed on every request.) Nginx talks HTTP/1.1 to the browser and HTTP/1.0 to the backend server. As such it handles keep-alive to the browser.

这个是不是不支持 ie6..ie789 呢?

#10 楼 @hooopo 哦,你说的是反向代理是 1.0 我搞错

You need to Sign in before reply, if you don't have an account, please Sign up first.