不同的Ruby on Rails生产Web服务器之间的建议(和区别) [英] Recommendations (and Differences) between different Ruby on Rails Production Web Servers

查看:94
本文介绍了不同的Ruby on Rails生产Web服务器之间的建议(和区别)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很快,我计划将我的第一个Ruby on Rails应用程序部署到生产环境中,甚至选择了一个Web主机,其中包含RoR提供程序所期望的所有托管服务器和Capistrano功能.

Very soon I plan on deploying my first Ruby on Rails application to a production environment and I've even picked a webhost with all the managed server and Capistrano goodness you'd expect from a RoR provider.

提供商允许杂种,瘦身,乘客和FastCGI Web服务器,看起来非常灵活,但是老实说我不知道​​它们之间的区别.我已经对它们进行了调查,但是当他们开始谈论功能和最大同时请求数时,这一切都会变得有很多-而且此数据似乎会因发布者的不同而有所差异.

The provider allows for Mongrel, Thin, Passenger & FastCGI web servers, which seems very flexible, but I honestly don't know the differences between them. I have looked into them some, but it all gets a bit much when they start talking about features and maximum simultaneous requests - and that this data seems to vary depending on who's publishing it.

我从表面上看了Passenger,这对我来说似乎很吸引人,但是我给旅客留下的印象是Passenger不是真正的Web服务器,而是更像是Apache或nginx之上的一层和托管的应用程序生成实例(例如Mongrel群集).

I have looked at Passenger (on the surface) - which does seem very appealing to me - but I was under the impression that Passenger wasn't the actual webserver, and instead was more like a layer on top of Apache or nginx and managed spawned instances of the application (like a Mongrel cluster).

任何人都可以请我直截了当地说明外行术语的差异,以便我可以明智地选择(因为任何见过 Indiana Jones和Last Crusade 的人都知道,如果选择不当会发生什么情况).

Can anyone please set me straight with the differences in layman's terms so as I can choose wisely (because anyone who's seen Indiana Jones and the Last Crusade knows what happens if you choose poorly).

推荐答案

简短答案

使用Apache/Nginx + Passenger.乘客很快,可靠,易于配置和部署.乘客已经被许多大型的Rails应用程序所采用,包括 Shopify .

Go with Apache/Nginx + Passenger. Passenger is fast, reliable, easy to configure and deploy. Passenger has been adopted by a large number of big Rails applications, including Shopify.


(来源: modrails.com )


(source: modrails.com)

详细答案

忘记CGI和FastCGI.最初没有其他选择,因此运行Rails的唯一方法是使用CGI或更快的浏览器FastCGI.如今,几乎没有人在CGI下运行Rails.最新的Rails版本不再提供.cgi和.fcgi运行程序.

Forget about CGI and FastCGI. In the beginning there were no other alternatives so the only way to run Rails was using CGI or the faster browser FastCGI. Nowadays almost nobody runs Rails under CGI. The latest Rails versions no longer provides .cgi and .fcgi runners.

Mongrel已被广泛采用,是CGI和FCGI的最佳替代方案.许多站点仍在使用Mongrel和Mongrel集群,但是Mongrel项目几乎已死,许多项目已经移至其他解决方案(主要是Passenger). 另外,基于Mongrel的体系结构很难配置,因为它需要一个前端代理(thin,ngnix)和一个由多个Mongrel实例组成的后端体系结构.

Mongrel has been a largely adopted solution, the best replacement for CGI and FCGI. Many sites still use Mongrel and Mongrel cluster, however Mongrel project is almost dead and many projects already moved to other solutions (mostly Passenger). Also, a Mongrel based architecture is quite hard to configure because it needs a frontend proxy (thin, ngnix) and a backend architecture composed of multiple Mongrel instances.

自发布以来,Passenger一直受到广泛关注.许多项目出于多种原因从杂种"转换为乘客",包括(但不限于)易于部署,可维护性和性能.另外,Passenger现在可用于Apache和Ngnix.

Passenger has been gaining widespread attention since it was released. Many projects switched from Mongrel to Passenger for many reasons, including (but not limited to) easy deployment, maintainability and performance. Additionally, Passenger is now available for both Apache and Ngnix.

使用Passenger的最简单方法是Apache + Passenger配置.一个Apache安装和多个Passenger进程.

The simplest way to use Passenger is the Apache + Passenger configuration. One Apache installation and multiple Passenger processes.

如果需要更好的性能和可伸缩性,可以将Ngnix用作前端代理,并将所有Rails请求转发到多个后端服务器,每个后端服务器均由Apache + Passenger组成. 我不在这里讨论技术细节,该解决方案旨在供高流量的Rails项目使用.

If you need better performance and scalability, you can use Ngnix as a frontend proxy and forward all Rails requests to multiple backend servers, each one composed of Apache + Passenger. I'm not going into the technical details here, this solution is intended to be used by Rails projects with an high level of traffic.

甚至更复杂的解决方案也包括不同级别的组合,包括http代理和服务器.您可以大致了解我正在从 GitHub Heroku .

Even more complex solutions include a combination of different levels including http proxies and servers. You can have an idea of what I'm talking about reading some internal details from GitHub and Heroku.

目前,对于大多数Rails项目来说,乘客"是最好的答案.

Right now, Passenger is the best answer for most Rails projects.

这篇关于不同的Ruby on Rails生产Web服务器之间的建议(和区别)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆