RoR:从 Ruby 到 Enterprise Ruby Edition(不节省内存?)

发布于 2024-10-10 01:11:52 字数 905 浏览 7 评论 0原文

我刚刚尝试切换到 Ruby Enterprise Edition,如下所述: http://www.rubyenterpriseedition.com/ download.html(案例:Ubuntu)。

REE 承诺节省大约 30% 的内存,但就我而言,我仍然有 3 个 ruby​​ 实例,每个实例大约 100MB - 就像以前一样(我认为这对于几乎空闲的服务器来说太多了......)。

所以我怀疑“旧”红宝石仍在使用,但我不确定。在 REE 安装之后(按照 Passenger 的说明),我在 Apache 配置文件中更改了一些路径:

以前:

LoadModule Passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2 /mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4
PassengerRuby /usr/bin/ruby1.8

新,带 REE:

LoadModule Passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.14/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.14
PassengerRuby /usr/local/bin/ruby

我还需要执行其他操作(例如修改其他一些路径)吗?如果是这样,什么以及如何?

谢谢您的帮助!
汤姆

I have just tried to switch to Ruby Enterprise Edition, as described here: http://www.rubyenterpriseedition.com/download.html (case: Ubuntu).

REE promises about 30% memory savings, but in my case, I still have 3 ruby instances around 100MB each - just like before (and I think this is way too much for an almost idle server...).

So I suspect the "old" ruby is still being used, but I'm not sure. What I've changed in the Apache config file, after the REE installation (following Passenger's instructions) are some paths:

PREVIOUSLY:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4
PassengerRuby /usr/bin/ruby1.8

NEW, with REE:

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.14/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.14
PassengerRuby /usr/local/bin/ruby

Do I need to do anything else (modify some other paths, for example)? If so, what and how?

Thank you for your help!
Tom

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

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

发布评论

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

评论(1

七婞 2024-10-17 01:11:52

当人们提到 REE 与其他解释器相比的内存节省时,他们指的是从基准测试生成的数据。

这些基准测试来自快速连续调用数千次的代码,因此这些数字反映了负载下的性能。 REE 通常名列前茅,因为它的垃圾收集能力更好,等等。

这并不反映应用程序空闲时消耗的 RAM 量。您可能会发现,在大多数(如果不是全部)情况下,REE 上的空闲 Rails 应用程序消耗的 RAM 量与同一服​​务器上的同一个应用程序消耗的 RAM 量几乎相同,但使用 MRI(Matz 的 Ruby 解释器 - 默认)会消耗相同数量的 RAM。消耗,因为它不处于使稀土发光的条件下。

在回答您的问题时,您可以在服务器上找到您现在指向乘客的 ruby​​:/usr/local/bin/ruby -v。如果没有报告 REE,那么您的路径设置错误。

When people refer to the memory savings of REE compared to other interpreters, they're referring to figures which have been generated from benchmarks.

These benchmarks are from code which is called many thousands of times in quick succession so that the numbers reflect performance under load. REE often comes out on top because its garbage collection is better, among a number of other things.

This does not reflect the amount of RAM an app consumes when idle. You'll probably find in most if not all cases that an idle rails app on REE will consume pretty much the same amount of RAM that the same app, on the same server, but using MRI (Matz' Ruby Interpreter - the default) would consume because it is not under the conditions which make REE shine.

In answer to your question, you can find out what the ruby you've now pointed passenger at is, on your server: /usr/local/bin/ruby -v. If that doesn't report REE, then you've set your paths wrong.

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