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

发布于 2024-07-18 18:11:37 字数 264 浏览 6 评论 0原文

我从一些书中了解到,Phusion Passenger 是轻松部署 Ruby on Rails 的答案。 但是我的朋友说,首先有Apache +一堆Mongrels,然后是lighttpd,然后是nginx,现在是Passenger,而且似乎无穷无尽......

他还说他使用dreamhost,它使用Passenger,有时他看到他的请求不正在处理。

所以我想知道Passenger是否是RoR部署的最终答案? 您是否使用它并使用“ab”命令来测试该网站是否运行良好?

I read from some books that Phusion Passenger is the answer to easy Ruby on Rails deployment. 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...

he also said he uses dreamhost which uses Passenger, and sometimes he sees his request not being processed.

So I wonder if Passenger is the final answer to RoR deployment? do you use it and used the "ab" command to test if the site is doing quite well?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

骄兵必败 2024-07-25 18:11:37

简短的回答:是的。

长答案:yeeeeeeeeeeeeeeeessssssssssssssss。

认真地说,Phusion Passenger 和 Ruby Enterprise Edition 几乎消除了将 Rails 应用程序迁移到生产环境的所有痛苦。 以前的方法,包括运行一套 Mongrels,需要围绕 Passenger 透明处理的启动、停止和回收侦听器进程进行大量设置,或者通过简单的 Apache(或 nginx)配置选项进行设置。 REE 的补充垃圾收集器意味着分叉新的侦听器使用更少的内存,并且启动速度更快(在 Passenger 的“智能”生成模式下)。

编辑:@srboisvert 提出了一个很好的观点; Passenger 并不是 RoR 部署的最终答案,但目前为止它是我最喜欢的。 有一天,在解决了许多困难的工程问题之后,主流 Ruby 可能会从使用多进程模型托管 RoR 转向单进程模型,这将使​​管理比 Passenger 更容易。

short answer: yes.

long answer: yeeeeeeeeeeeeeeesssssssssssssssss.

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. 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. 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).

Edit: @srboisvert makes a very good point; Passenger isn't the final answer to RoR deployment, but for now it's my favorite by far. 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.

把人绕傻吧 2024-07-25 18:11:37

这是迄今为止最好的解决方案。 我开始使用 FCGI 进行部署,这很痛苦。 然后杂种来了,情况更好了。 然后 mod_rails 出现了,它好多了。

此外,许多大型酷应用程序正在迁移到 mod_rails,其中包括 37signals 的一些应用程序,所以您知道这很好。

最后引用 DHH 的一句话作为结束:

Phusion 的一体式解决方案
乘客

一旦你完成了令人难以置信的
安装简单,你就得到一个Apache
既充当网络服务器,又充当负载
平衡器、应用服务器和
进程观察者。 您只需加入
您的应用程序和触摸
tmp/restart.txt 当你想要的时候
弹起它然后砰的一声,你就起来了
正在运行。

但不知何故,乘客的消息
沉入的速度有点慢。
已经有很多大型网站了
跑掉它。 包括 Shopify、
MTV、Geni、Yammer,我们将搬家
很快就完成了第一个 Ta-da 列表,然后
希望剩下的 37 个信号
此后迅速套房。

因此,尽管仍有理由
运行您自己的自定义多层设置
手动配置的部分,只是
就像有人回避一样
我认为 mod_php 的详细信息
我们最终决定默认
回答。 不需要的东西
你要认真考虑第一个
部署 Rails 应用程序。
刚刚发挥作用的东西
盒子。 即使那个盒子是共享的
楼主!

总而言之,Rails 不再难
部署。 Phusion Passenger 已做出
这非常简单。

来自

It's the best solution so far. I started deploying with FCGI and it was a pain. Then came mongrel and it was better. Then came mod_rails and it was WAY better.

Also a lot of large cool application are migrating to mod_rails including some by 37signals, so you know that's good.

I'll just end with a quote from DHH:

The one-piece solution with 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. You simply drop in
your application and touch
tmp/restart.txt when you want to
bounce it and bam, you're up and
running.

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.

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. Something that doesn't require
you to really think about the first
deployment of your Rails application.
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. Phusion Passenger has made
it ridiculously easy.

(via)

九命猫 2024-07-25 18:11:37

是的,这是最简单、最快、最有效的解决方案。
在最近的版本中解决了诸如soap4r等gems的许多问题之后,Passenger现在是部署问题的答案。

我们在平衡环境中运行 Apache/mod_rails,并在 2 台服务器前面使用 HAProxy。 它比我们之前使用 Mongrel/Aapache 的设置可靠得多。

控制

  • Apache 中运行的 Passenger 进程数量、
  • 每个应用程序运行的 Passenger 进程数量
  • 以及所有这些都非常容易,而无需调整许多配置文件(如 mod_proxy、Apache)。
  • 设置虚拟主机并在 Apache 配置中添加 3 行基本上足以让它运行

Matt

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.

We're running Apache/mod_rails in a balanced environment with HAProxy in front of 2 servers. It's much more reliable than our previous setup using Mongrel/Aapache.

It's very easy to take control over

  • the amount of Passenger processes running in 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.
  • setting up a virtual host and adding 3 lines to your Apache config is basically enough to get it running

Matt

情域 2024-07-25 18:11:37

最终答案? 没有什么永远是最终的答案。

我想说,乘客是当前的答案。

Final Answer? Nothing is ever the final answer.

I'd say Passenger is the current answer though.

半边脸i 2024-07-25 18:11:37

是的。 自从几周前他们发布了 2.2.0 以来,我一直在 Apache 之前运行 Nginx/Passenger 来处理仍然需要 PHP 的事情。 尤其是 Ruby Enterprise Edition,它接近我所说的“完美”。

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. Especially with Ruby Enterprise Edition, it approaches what I would call "perfect".

怎言笑 2024-07-25 18:11:37

我想现在人们会坚持使用 mod_rails 多年。 该模块确实很好。 配置非常简单。 很难用更好的解决方案来取代它。 与mod_php类似。 唯一缺少的关键组件是:Windows 端口。

I guess that now people will stick to mod_rails for many years. The module is really good. Configuration is dead simple. It will be hard to replace it with some better solution. Similar to mod_php. The only key component which is missing: Windows port.

原谅我要高飞 2024-07-25 18:11:37

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

In some situations (enterprise, etc) the JVM can also be a good option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文