【问题标题】:what happened when set jruby min runtime?设置 jruby min 运行时发生了什么?
【发布时间】:2013-02-15 05:53:47
【问题描述】:

我现在在 Jruby on Rails 上苦苦挣扎。我们之前没有配置最小/最大 jruby 运行时,门户运行良好。

这几天,我发现设置这些配置会提高我们门户的性能,所以我决定这样配置:

config.webxml.jruby.min.runtimes = 2
config.webxml.jruby.max.runtimes = 4

但是,我设置后我们的门户无法启动,日志继续抛出java类找不到错误:

INFO: Info: received max runtimes = 4
Dec 19, 2012 1:57:18 PM org.apache.catalina.core.ApplicationContext log
INFO: Info: received min runtimes = 2
Dec 19, 2012 1:57:18 PM org.apache.catalina.core.ApplicationContext log
INFO: Info: received max runtimes = 4
Dec 19, 2012 1:57:18 PM org.apache.catalina.core.ApplicationContext log
INFO: An exception happened during JRuby-Rack startup
cannot link Java class com.portal.util.selector.SelectorUtil, probable missing dependency: Could not initialize class com.portal.util.selector.SelectorUtil
--- System
jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-12 85838f6) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_35) [linux-amd64-java]
Time: Wed Dec 19 13:57:18 +0000 2012
Server: Apache Tomcat/6.0.35
jruby.home: file:/var/tomcat/webapps/ROOT/WEB-INF/lib/jruby-stdlib-1.6.1.jar!/META-INF/jruby.home

当我们设置这个最小/最大 jruby 运行时有什么区别?任何人都可以让我摆脱这一切吗?

提前致谢。

【问题讨论】:

  • 任何人都可以帮我解决这个问题???
  • Could not initialize class com.portal.util.selector.SelectorUtil 建议您缺少应该具有此类的 JAR。你有吗?

标签: jruby tomcat6 warbler


【解决方案1】:

jruby thread safe comparison

在 config/warbler.rb 中

config.webxml.jruby.min.runtimes = 1
config.webxml.jruby.max.runtimes = 1

在 config/environments/production.rb 中

config.threadsafe!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-06
    • 1970-01-01
    • 1970-01-01
    • 2011-12-01
    • 2023-03-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多