0
DigitalSonic Oct. 2009 It’s a Bird… It’s a Plane… No, it’s Superman
How many Rails developers have Java knowledge?
<ul><li>The Best of JVM </li></ul><ul><li>It’s Just Ruby </li></ul><ul><li>Platform Independent </li></ul>
Have a Try <ul><li>Download the latest JRuby distribution </li></ul><ul><li>Unpack </li></ul><ul><li>Add the bin path to $...
Ruby => JRuby <ul><li>ruby    jruby </li></ul><ul><li>C backend libraries    Java backend libraries </li></ul><ul><li>… ...
Ruby on Rails => JRuby on Rails adapter: mysql mongrel RMagick … adapter:  jdbcmysql mongrel -jruby RMagick 4J …
Both  Rails  and  Java EE  projects are running in the  same  Java AS?
Warbler <ul><li>Warbler  is a gem that makes a .war file out of a Rails, Merb, or Rack-based application.  </li></ul>http:...
Rails in Java AS <ul><li>Tomcat </li></ul><ul><li>Jetty (jetty-rails) </li></ul><ul><li>Glassfish v2 / v3 (gem) </li></ul>...
Rails in Java AS (cont.) <ul><li>Larger JVM Memory Size </li></ul><ul><li>Server JVM </li></ul><ul><li>Latest JDK </li></u...
Showcase: Blog <ul><li>Getting Started with Rails </li></ul><ul><ul><li>http://guides.rubyonrails.org/getting_started.html...
Showcase: Blog (cont.)
Showcase: Monitor <ul><li>Tomcat Monitor Tools </li></ul><ul><ul><li>PSI Probe (Lambda Probe) </li></ul></ul><ul><ul><li>H...
Showcase: Monitor (cont.)
Showcase: Monitor (cont.)
Showcase: Simple Tuning <ul><li>VM </li></ul><ul><ul><li>-Xmx768m -Xms768m -Xmn256m -XX:MaxPermSize=128m -XX:PermSize=128m...
Showcase: Simple Tuning (cont.) Ubuntu 8.10, kernel 2.6.27-14-generic JDK 1.6.0 Update 10 JRuby 1.3.1 Apache Tomcat 6.0.20...
Reference <ul><li>http://jruby.org </li></ul><ul><li>http://rubyonrails.org/ </li></ul><ul><li>http://kenai.com/projects/j...
Q & A
 
Upcoming SlideShare
Loading in...5
×

It's Ruby...It's Java...No, it's JRuby

1,668

Published on

This is the slide of the JRuby topic in Kungfu Rails 2009, Shanghai, China.
It's about how to deploy rails app to Java application servers.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,668
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "It's Ruby...It's Java...No, it's JRuby"

  1. 1. DigitalSonic Oct. 2009 It’s a Bird… It’s a Plane… No, it’s Superman
  2. 2. How many Rails developers have Java knowledge?
  3. 3. <ul><li>The Best of JVM </li></ul><ul><li>It’s Just Ruby </li></ul><ul><li>Platform Independent </li></ul>
  4. 4. Have a Try <ul><li>Download the latest JRuby distribution </li></ul><ul><li>Unpack </li></ul><ul><li>Add the bin path to $PATH or %PATH% </li></ul><ul><li>Test it </li></ul><ul><ul><li>jruby –v </li></ul></ul><ul><ul><li>jirb </li></ul></ul><ul><ul><li>jirb_swing </li></ul></ul>
  5. 5. Ruby => JRuby <ul><li>ruby  jruby </li></ul><ul><li>C backend libraries  Java backend libraries </li></ul><ul><li>… </li></ul><ul><li>gem  jruby –S gem </li></ul><ul><li>rake  jruby –S rake </li></ul><ul><li>rails  jruby –S rails </li></ul>
  6. 6. Ruby on Rails => JRuby on Rails adapter: mysql mongrel RMagick … adapter: jdbcmysql mongrel -jruby RMagick 4J …
  7. 7. Both Rails and Java EE projects are running in the same Java AS?
  8. 8. Warbler <ul><li>Warbler is a gem that makes a .war file out of a Rails, Merb, or Rack-based application. </li></ul>http://kenai.com/projects/warbler
  9. 9. Rails in Java AS <ul><li>Tomcat </li></ul><ul><li>Jetty (jetty-rails) </li></ul><ul><li>Glassfish v2 / v3 (gem) </li></ul><ul><li>JBoss (JBoss-Rails) </li></ul><ul><li>… </li></ul>
  10. 10. Rails in Java AS (cont.) <ul><li>Larger JVM Memory Size </li></ul><ul><li>Server JVM </li></ul><ul><li>Latest JDK </li></ul><ul><li>Sun JDK / BEA JRockit ? </li></ul><ul><li>Connection Pool </li></ul><ul><li>Load-Balance </li></ul>
  11. 11. Showcase: Blog <ul><li>Getting Started with Rails </li></ul><ul><ul><li>http://guides.rubyonrails.org/getting_started.html </li></ul></ul><ul><li>Step by Step </li></ul><ul><ul><li>jruby -S rails blog </li></ul></ul><ul><ul><li>Modify database settings </li></ul></ul><ul><ul><li>jruby -S warble config </li></ul></ul><ul><ul><li>Modify config/warble.rb </li></ul></ul><ul><ul><li>jruby -S warble war </li></ul></ul><ul><ul><li>Deploy into Tomcat </li></ul></ul>
  12. 12. Showcase: Blog (cont.)
  13. 13. Showcase: Monitor <ul><li>Tomcat Monitor Tools </li></ul><ul><ul><li>PSI Probe (Lambda Probe) </li></ul></ul><ul><ul><li>Hyperic HQ </li></ul></ul><ul><li>VM Monitor Tools </li></ul><ul><ul><li>JConsole </li></ul></ul><ul><ul><li>VisualVM </li></ul></ul><ul><ul><li>JRockit Mission Control </li></ul></ul>
  14. 14. Showcase: Monitor (cont.)
  15. 15. Showcase: Monitor (cont.)
  16. 16. Showcase: Simple Tuning <ul><li>VM </li></ul><ul><ul><li>-Xmx768m -Xms768m -Xmn256m -XX:MaxPermSize=128m -XX:PermSize=128m </li></ul></ul><ul><li>Tomcat Connector </li></ul><ul><ul><li>maxThreads=&quot;1024&quot; minSpareThreads=&quot;32&quot; maxSpareThreads=&quot;128&quot; enableLookups=&quot;false&quot; </li></ul></ul><ul><li>JNDI Connection Pool </li></ul><ul><li>For my laptop only, not for production environment </li></ul><ul><li>Some parameters are set without measurement </li></ul>
  17. 17. Showcase: Simple Tuning (cont.) Ubuntu 8.10, kernel 2.6.27-14-generic JDK 1.6.0 Update 10 JRuby 1.3.1 Apache Tomcat 6.0.20 Mongrel 1.1.5 rails 2.2.2 activerecord-jdbc-adapter 0.9.2 jdbc-mysql 5.0.4 warbler 0.9.14
  18. 18. Reference <ul><li>http://jruby.org </li></ul><ul><li>http://rubyonrails.org/ </li></ul><ul><li>http://kenai.com/projects/jruby/ </li></ul><ul><li>Practical JRuby on Rails Web 2.0 Projects </li></ul><ul><li>JRuby Cookbook </li></ul>
  19. 19. Q & A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×