简体   繁体   English

是mod_rails还是Phusion Passenger最终是Ruby on Rails部署的答案?

[英]is mod_rails or Phusion Passenger finally the answer to Ruby on Rails Deployment?

I read from some books that Phusion Passenger is the answer to easy Ruby on Rails deployment. 我从一些书中了解到Phusion Passenger是轻松进行Ruby on Rails部署的答案。 But my friend said that first there was Apache + bunch of Mongrels, and then lighttpd, and then nginx, and now Passenger, and it seems endless... 但是我的朋友说,首先是Apache +一堆Mongrels,然后是lighttpd,然后是nginx,现在是Passenger,这似乎无穷无尽...

he also said he uses dreamhost which uses Passenger, and sometimes he sees his request not being processed. 他还说,他使用的Dreamhost使用的是Passenger,有时他会看到自己的请求未得到处理。

So I wonder if Passenger is the final answer to RoR deployment? 因此,我想知道“乘客”是否是RoR部署的最终答案? do you use it and used the "ab" command to test if the site is doing quite well? 您是否使用它并使用“ ab”命令来测试站点是否运行良好?

short answer: yes. 简短的回答:是的。

long answer: yeeeeeeeeeeeeeeesssssssssssssssss. 长答案:yeeeeeeeeeeeeeeeeeeessssssssssssssss。

In all seriousness, Phusion Passenger and Ruby Enterprise Edition have taken out pretty much all of the pain of moving a Rails app into production. 严肃地说,Phusion Passenger和Ruby Enterprise Edition消除了将Rails应用程序投入生产的所有痛苦。 Previous approaches, including running a suite of Mongrels, required lots of setup surrounding starting, stopping, and recycling listener processes that Passenger handles transparently, or via simple Apache (or nginx) configuration options. 以前的方法(包括运行一套Mongrels)需要围绕Passenger透明处理或通过简单的Apache(或nginx)配置选项处理的启动,停止和回收侦听器进程进行大量设置。 And REE's complementary garbage collector means that forking off a new listener uses MUCH less memory, and is faster to boot (in Passenger's "smart" spawning mode). REE的补充垃圾收集器意味着,派生一个新的侦听器使用的内存更少,并且启动速度更快(在Passenger的“智能”生成模式下)。

Edit: @srboisvert makes a very good point; 编辑:@srboisvert提出了一个很好的观点; Passenger isn't the final answer to RoR deployment, but for now it's my favorite by far. 乘客并不是部署RoR的最终答案,但到目前为止,这是我最喜欢的。 One day, after a lot of hard engineering problems are solved, mainstream Ruby will probably move from hosting RoR using a multi-process model to a single-process model, which would make management even easier than with Passenger. 有一天,在解决了许多艰巨的工程问题之后,主流Ruby可能会从使用多进程模型托管RoR迁移到单进程模型,这将使​​管理工作比使用Passenger更加容易。

It's the best solution so far. 到目前为止,这是最好的解决方案。 I started deploying with FCGI and it was a pain. 我开始使用FCGI进行部署,这很痛苦。 Then came mongrel and it was better. 然后是杂种,它更好。 Then came mod_rails and it was WAY better. 然后出现了mod_rails,而且效果更好。

Also a lot of large cool application are migrating to mod_rails including some by 37signals, so you know that's good. 另外,许多大型的很酷的应用程序正在迁移到mod_rails,其中包括一些37signals,因此您知道这很好。

I'll just end with a quote from DHH: 我将以DHH的报价结尾:

The one-piece solution with Phusion Passenger Phusion Passenger的一体式解决方案

Once you've completed the incredibly simple installation, you get an Apache that acts as both web server, load balancer, application server and process watcher. 完成极其简单的安装后,您将获得一个既充当Web服务器,负载均衡器,应用程序服务器又充当进程监视程序的Apache。 You simply drop in your application and touch tmp/restart.txt when you want to bounce it and bam, you're up and running. 您只需放入您的应用程序,然后在想要启动并运行bam时触摸tmp / restart.txt,即可启动并运行。

But somehow the message of Passenger has been a little slow to sink in. There's already a ton of big sites running off it. 但是,以某种方式,“乘客”的信息陷入了一点缓慢。已经有大量的大型站点在运行它。 Including Shopify, MTV, Geni, Yammer, and we'll be moving over first Ta-da List shortly, then hopefully the rest of the 37signals suite quickly thereafter. 包括Shopify,MTV,Geni,Yammer在内,我们将很快移至首个Ta-da List,然后希望此后37signals套件中的其余部分很快。

So while there are still reasons to run your own custom multi-tier setup of manually configured pieces, just like there are people shying away from mod_php for their particulars, I think we've finally settled on a default answer. 因此,尽管仍然有理由运行自己的手动多层配置的自定义多层设置,就像有些人不愿透露mod_php的详细信息一样,我认为我们终于找到了默认答案。 Something that doesn't require you to really think about the first deployment of your Rails application. 不需要您真正考虑一下Rails应用程序的第一次部署的事情。 Something that just works out of the box. 开箱即用的东西。 Even if that box is a shared host! 即使那个盒子是共享主机!

In conclusion, Rails is no longer hard to deploy. 总之,Rails不再难以部署。 Phusion Passenger has made it ridiculously easy. Phusion Passenger使其变得异常简单。

( via ) 通过

Yes, it is the easiest, fastest and most efficient solution. 是的,它是最简单,最快和最有效的解决方案。 After a lot of problems with gems like soap4r etc. had been resolved in recent releases, Passenger is the answer to deployment questions now. 在最近发行版中解决了许多诸如soap4r等宝石问题之后,Patient现在是部署问题的答案。

We're running Apache/mod_rails in a balanced environment with HAProxy in front of 2 servers. 我们在平衡的环境中运行Apache / mod_rails,其中HAProxy位于2台服务器的前面。 It's much more reliable than our previous setup using Mongrel/Aapache. 它比我们以前使用Mongrel / Aapache的设置可靠得多。

It's very easy to take control over 掌控权非常容易

  • the amount of Passenger processes running in Apache Apache中运行的乘客进程数量
  • the amount of Passenger processes running per application 每个应用程序运行的旅客流程数量
  • and all that without the pain of tweaking a number of config files like mod_proxy, Apache. 无需调整许多配置文件,例如mod_proxy,Apache。
  • setting up a virtual host and adding 3 lines to your Apache config is basically enough to get it running 设置虚拟主机并将3行添加到您的Apache配置中基本上足以使其运行

Matt 马特

Final Answer? 最后的答案? Nothing is ever the final answer. 没有什么是最终的答案。

I'd say Passenger is the current answer though. 我会说,旅客是目前的答案。

Yes. 是。 I've been running Nginx/Passenger in front of Apache for whatever still needs PHP since they released 2.2.0 a few weeks back. 自几周前他们发布2.2.0版本以来,我一直在Apache之前运行Nginx / Passenger,以解决仍然需要PHP的问题。 Especially with Ruby Enterprise Edition, it approaches what I would call "perfect". 特别是在Ruby Enterprise Edition中,它接近了我所谓的“完美”。

I guess that now people will stick to mod_rails for many years. 我想现在人们将坚持使用mod_rails很多年了。 The module is really good. 该模块真的很好。 Configuration is dead simple. 配置非常简单。 It will be hard to replace it with some better solution. 很难用更好的解决方案代替它。 Similar to mod_php. 类似于mod_php。 The only key component which is missing: Windows port. 唯一缺少的关键组件:Windows端口。

在某些情况下(企业等), JVM也是一个不错的选择。

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

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