Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JRuby @ OpenFeint

flyerhzm
November 19, 2012

JRuby @ OpenFeint

一次JRuby迁移成功的案例

flyerhzm

November 19, 2012
Tweet

More Decks by flyerhzm

Other Decks in Technology

Transcript

  1. 关于我 • 黄志敏 Richard Huang (a.k.a flyerhzm) • 之前是OpenFeint资深工程师 现在是GREE咨询顾问

    • 活跃于Ruby/JRuby的开源社区 • 个人主页 http://huangzhimin.com twitter, weibo, github: flyerhzm
  2. Not a Vendor Pitch: Real World Rails Apps at Massive

    Scale:: A Panel Discussion with New Relic, Groupon, Zendesk, Fanzter, and Uken http://railsconf2012.com/sessions/66
  3. Up and to the right – how Spiceworks is scaling

    200 million requests per month http://railsconf2012.com/sessions/62
  4. REE 1.8.7 2010.01 + passenger 331 ms JRuby 1.6.7.2 +

    torquebox 51.5 ms 禁用mysql sharding,background job和其它无法工作的部分 部署在qa服务器上,memcached, redis, rabbitmq和app server在同一台机器 ree没有优化gc
  5. Trinidad 基于 Tomcat Torquebox 基于 JBoss AS Mizuno 基于 Jetty

    Puma 新的ruby server (rack 版本问题)
  6. read action write action REE 1.8.7 2010.01 + passenger 448

    ms 44 ms Ruby 1.9.3 p194 + passenger 374 ms 42 ms JRuby 1.7.0.RC2 + torquebox-lite 187 ms 38 ms 在备机上进行测试 连接产品环境的mysql, memcached, redis, rabbitmq等等 REE使用Twitter提供的GC优化
  7. Rolling restart sudo /etc/init.d/jboss-as-standalone restart 1. 从LB中移除服务器A 2. 在服务器A上重启JBOSS 3.

    把服务器A加回到LB中 4. 对每台服务器重复以上操作 零宕机 http://jrubytips.com/posts/5-zero-downtime-deployment
  8. bug 18:29:03,515 ERROR [org.torquebox.core.runtime] (Thread-71) Error during execution: ENV['RAILS_ROOT']=RACK_ROOT ENV['RAILS_ENV']=RACK_ENV

    require %q(org/torquebox/web/rails/boot) : org.jruby.exceptions.RaiseException: (LoadError) load error: haml/buffer -- java.lang.NoClassDefFoundError: org/jruby/runtime/ThreadContext at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1010) [jruby.jar:] at ActiveSupport::Dependencies::Loadable.require (/home/deploy/rails_apps/openfeint_platform/shared/bundle/jruby/1. 8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182)