简体   繁体   English

nginx不会通过精简的Rails应用流式传输文件

[英]nginx doesn't stream file through thin runned rails app

Ive a rails 4 app running which is used for file exchange. 我正在运行Rails 4应用程序,用于文件交换。 Its basicly running very well but when I try to download a file that is bigger then some hundred mb its getting slow. 它基本上运行得很好,但是当我尝试下载一个更大的文件时,它会变慢几百mb。 I think this is because nginx doenst stream the file it's first loading the file to the ram and then sends it. 我认为这是因为nginx确实会流式传输文件,因此首先将文件加载到ram,然后再将其发送。

I have sendfile on; 我有sendfile on; in my nginx config and config.action_dispatch.x_sendfile_header set to true in my config/environments/production.conf . 在我的nginx配置中,并且在config/environments/production.conf中将config.action_dispatch.x_sendfile_header设置为true。 Im using thin as a webserver. 我使用瘦作为网络服务器。

Does anyone have an idea about what Im doing wrong? 有人知道我在做什么错吗?

I don't think thin supports Rails implementation of streaming out of the box . 我不认为Thin支持开箱即用的 Rails实现流。

There was some work done on that front, but afaik it was never merged to master branch. 在这方面已经做了一些工作 ,但是afaik从未合并到master分支中。

Instead of thin , our team switched to using puma on our local machines, and we're using passenger on our production server (although in the light of recent article from Engine Yard, we're considering switching our production app server to either unicorn on puma ). 取而代之的thin ,我们的团队转而使用彪马在我们本地的机器,我们正在使用passenger我们的生产服务器上(虽然在最近的光从Engine Yard的,我们正在考虑我们的生产应用服务器切换到无论是unicornpuma )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM