Mais conteúdo relacionado Semelhante a GlassFish can support multiple Ruby frameworks ... really ? (20) GlassFish can support multiple Ruby frameworks ... really ?1. GlassFish can support multiple
Ruby frameworks ... really ?
Arun Gupta, Oracle Corp
blogs.sun.com/arungupta, @arungupta
11. JRuby
• Ruby interpreter written in Java
• Current Version: 1.4.0
• 1.5 RC coming soon
• Ruby 1.8.7 compatible
• Some Ruby 1.9 support
• --1.9 flag (80%)
12. • Solid performance (~Ruby 1.9)
• Startup is poor, execution usually better than 1.9
• Runs native threads
• Foreign Function Interface (FFI)for C
libraries
• Adopted from Rubinius, CRuby gem
• Runs Rails great!
14. GlassFish v3 Architecture
JSF Grails ... Rails Merb ... Django ...
Servlet Spec Rack WSGI
Web JRuby Jython
Container Container Container
V3 Kernel
Grizzly
JVM
Key GlassFish v3 Modules Java Framework Python Framework
Web Framework
Ruby Framework
Interface
16. Why ? - Easy prototyping, yet powerful
18. Why ? - Database Connection Pooling
23. jruby -S gem install glassfish
jruby -S rails helloworld
cd helloworld
jruby -S glassfish
http://blogs.sun.com/arungupta/entry/totd_70_jruby_and_glassf sh
i
24. jruby -S glassfish -h
-c: change the context root
-e: environment
-d: Runs as daemon
-P: location of PID file
-l: log file location
-log-level: Logging level (0-7)
27. jruby -S gem install warbler
jruby -S warble
http://blogs.sun.com/arungupta/entry/totd_73_jruby_and_glassf sh
i
31. Deployment Options
http://blogs.sun.com/arungupta/entry/totd_81_how_to_use
http://blog.headius.com/2009/04/apache-jruby-rails-glassf sh-easy.html
i
33. Ruby Monitoring
• Basic Monitoring
• jinfo: System properties and VM CLI flags
• jmap: Shared object memory map
• jstack: Stack traces of Java threads
• jstat: Performance statistics on class, JIT compiler, GC, ...
• Advanced
• jconsole / Visual VM
• NewRelic, FiveRuns, ...
34. jConsole
http://blogs.sun.com/arungupta/tags/rubyonrails+jmx
38. Turbo charging your JRuby Startup
• “-client” or “-server” ? (Upto 50%)
• Faster startup or solid runtime ?
• export JAVA_OPTS=”-client -D32”
• Upto 50% improvement
• For Linux: Class Data Sharing
• Delay or disable JRuby's JIT (Upto 10%)
• -X-C
• jruby.compile.mode=OFF
• Avoid spawning “sub-Rubies”
• Nailgun for small JRuby CLI invocations
• Favorite JVM Flags
http://blog.headius.com/2010/03/jruby-startup-time-tips.html
40. GlassFish can support multiple
Ruby frameworks ... really ?
Arun Gupta, Oracle Corp
blogs.sun.com/arungupta, @arungupta