it's ruby...it's java...no, it's jruby

of 20 /20
DigitalSonic Oct. 2009 It’s a Bird… It’s a Plane… No, it’s Superman

Author: digitalsonic

Post on 20-Aug-2015

1.704 views

Category:

Technology


4 download

Embed Size (px)

TRANSCRIPT

Page 1: It's Ruby...It's Java...No, it's JRuby

DigitalSonicOct. 2009

It’s a Bird…

It’s a Plane…

No, it’s Superman

It’s a Bird…

It’s a Plane…

No, it’s Superman

Page 2: It's Ruby...It's Java...No, it's JRuby

How many Rails developers How many Rails developers have Java knowledge?have Java knowledge?

Page 3: It's Ruby...It's Java...No, it's JRuby

• The Best of JVMThe Best of JVM

• It’s Just RubyIt’s Just Ruby

• Platform IndependentPlatform Independent

Page 4: It's Ruby...It's Java...No, it's JRuby

Have a TryHave a Try

• Download the latest JRuby distribution• Unpack• Add the bin path to $PATH or %PATH%• Test it

jruby –vjirbjirb_swing

Page 5: It's Ruby...It's Java...No, it's JRuby

Ruby => JRubyRuby => JRuby

• ruby jruby• C backend libraries Java backend libraries• …

• gem jruby –S gem• rake jruby –S rake• rails jruby –S rails

Page 6: It's Ruby...It's Java...No, it's JRuby

Ruby on Rails => JRuby on RailsRuby on Rails => JRuby on Rails

adapter: mysqlmongrelRMagick…

adapter: jdbcmysqlmongrel-jrubyRMagick4J…

Page 7: It's Ruby...It's Java...No, it's JRuby

Both Both RailsRails and and Java EE Java EE projects are projects are running in the running in the samesame Java AS? Java AS?

Page 8: It's Ruby...It's Java...No, it's JRuby

WarblerWarbler

• WarblerWarbler is a gem that makes a .war file out of a Rails, Merb, or Rack-based application.

http://kenai.com/projects/warbler

Page 9: It's Ruby...It's Java...No, it's JRuby

Rails in Java ASRails in Java AS

• Tomcat• Jetty (jetty-rails)• Glassfish v2 / v3 (gem)• JBoss (JBoss-Rails)• …

Page 10: It's Ruby...It's Java...No, it's JRuby

Rails in Java AS (cont.)Rails in Java AS (cont.)

• Larger JVM Memory Size• Server JVM• Latest JDK• Sun JDK / BEA JRockit ?

• Connection Pool• Load-Balance

Page 11: It's Ruby...It's Java...No, it's JRuby

Showcase: BlogShowcase: Blog• Getting Started with Rails

http://guides.rubyonrails.org/getting_started.html

• Step by StepStep by Stepjruby -S rails blogModify database settingsjruby -S warble configModify config/warble.rbjruby -S warble warDeploy into Tomcat

Page 12: It's Ruby...It's Java...No, it's JRuby

Showcase: Blog (cont.)Showcase: Blog (cont.)

Page 13: It's Ruby...It's Java...No, it's JRuby

Showcase: MonitorShowcase: Monitor

• Tomcat Monitor ToolsPSI Probe (Lambda Probe)Hyperic HQ

• VM Monitor ToolsJConsoleVisualVMJRockit Mission Control

Page 14: It's Ruby...It's Java...No, it's JRuby

Showcase: Monitor (cont.)Showcase: Monitor (cont.)

Page 15: It's Ruby...It's Java...No, it's JRuby

Showcase: Monitor (cont.)Showcase: Monitor (cont.)

Page 16: It's Ruby...It's Java...No, it's JRuby

Showcase: Simple TuningShowcase: Simple Tuning

• VMVM -Xmx768m -Xms768m -Xmn256m -XX:MaxPermSize=128m -

XX:PermSize=128m

• Tomcat ConnectorTomcat Connector maxThreads="1024" minSpareThreads="32" maxSpareThreads="128"

enableLookups="false"

• JNDI Connection PoolJNDI Connection Pool

For my laptop only, not for production environment Some parameters are set without measurement

Page 17: It's Ruby...It's Java...No, it's JRuby

Showcase: Simple Tuning (cont.)Showcase: Simple Tuning (cont.)

Ubuntu 8.10, kernel 2.6.27-14-genericJDK 1.6.0 Update 10JRuby 1.3.1Apache Tomcat 6.0.20Mongrel 1.1.5

rails 2.2.2activerecord-jdbc-adapter 0.9.2jdbc-mysql 5.0.4warbler 0.9.14

Page 18: It's Ruby...It's Java...No, it's JRuby

ReferenceReference

• http://jruby.org• http://rubyonrails.org/• http://kenai.com/projects/jruby/

• Practical JRuby on Rails Web 2.0 Projects• JRuby Cookbook

Page 19: It's Ruby...It's Java...No, it's JRuby

Q & A

Page 20: It's Ruby...It's Java...No, it's JRuby