SlideShare une entreprise Scribd logo
1  sur  66
JRuby on
                          Rails




                        fabio.kung@caelum.com.br
Monday, March 2, 2009
http://www.robert-tolksdorf.de/vmlanguages.html




Monday, March 2, 2009
DSLs


Monday, March 2, 2009
DSLs
                           Externa
         Interna (host)


Monday, March 2, 2009
HAPPY INTERNATIONAL
                        INVOKEDYNAMIC DAY




                                           JSR-292


                            http://openjdk.java.net/projects/mlvm/
Monday, March 2, 2009
Monday, March 2, 2009
Mas e por que
                           Java?




                                        “por que?”
Monday, March 2, 2009
Memória
                          Heap


                          objeto


                          objeto
                          objeto


                          objeto


                          objeto
                          objeto


                          objeto


Monday, March 2, 2009
Memória
                          Heap


                          objeto


                          objeto
                          objeto


                          objeto


                          objeto
                          objeto


                          objeto


Monday, March 2, 2009
Memória
                          Heap


                          objeto


                          objeto
                          objeto


                          objeto


                          objeto
                          objeto


                          objeto


Monday, March 2, 2009
Memória
                          Heap


                          objeto


                          objeto
                          objeto


                          objeto


                          objeto
                          objeto


                          objeto


Monday, March 2, 2009
Memória
                          Heap


                          objeto


                          objeto
                          objeto


                          objeto


                          objeto
                          objeto


                          objeto


Monday, March 2, 2009
95% dos
       objetos tem vida
            curta




Monday, March 2, 2009
Mortalidade Infantil
                               Memória Heap

                    Eden                      Tenured




Monday, March 2, 2009
Mortalidade Infantil
                               Memória Heap

                    Eden                      Tenured




Monday, March 2, 2009
Mortalidade Infantil
                                     Memória Heap

                    Eden                            Tenured



           objeto


                        objeto


                            objeto
           objeto



Monday, March 2, 2009
Mortalidade Infantil
                                     Memória Heap

                    Eden                            Tenured



           objeto


                        objeto


                            objeto
           objeto



Monday, March 2, 2009
Mortalidade Infantil
                                 Memória Heap

                    Eden                        Tenured



           objeto


                        objeto
                                                objeto



           objeto



Monday, March 2, 2009
Flexibilidade
               • Serial
               • ParNew
               • Parallel Scavenge
               • Serial Old
               • CMS
               • Parallel Old
               • G1
   http://blogs.sun.com/jonthecollector/entry/our_collectors
Monday, March 2, 2009
Ea
                        performance?



Monday, March 2, 2009
http://headius.blogspot.com/2008/02/jruby-rc2-released-whats-next.html




         JRuby's performance
      regularly exceeds Ruby
     1.8.6, and in many cases has
     started to exceed Ruby 1.9




http://www.flickr.com/photos/diathesis/2115578333/
Monday, March 2, 2009
JIT Compiler




Monday, March 2, 2009
Startup


               • -X:bootclasspath
               • Nailgun:
                        http://www.martiansoftware.com/nailgun/




Monday, March 2, 2009
Startup
               • -X:bootclasspath
               • Nailgun:
                        http://www.martiansoftware.com/nailgun/

                               Nailgun
                                         tcp/ip
                               Client

                               Nailgun
                                         tcp/ip   JVM Server
                               Client

                               Nailgun
                                         tcp/ip
                               Client

Monday, March 2, 2009
Rails não
                     escala!




Monday, March 2, 2009
http://www.akitaonrails.com/2008/4/19/di-rio-de-bordo-do-fisl-9




                                           Sim! Rails
                                            escala!



http://picasaweb.google.com/leo.torres84/FISL2008
Monday, March 2, 2009
Ruby on Rails



                        http   WebServer         Rails
                                           CGI




                                                         “como?”
Monday, March 2, 2009
Ruby on Rails

                                                 Rails
                                           CGI



                        http   WebServer         Rails
                                           CGI



                                           CGI   Rails



                                                         “como?”
Monday, March 2, 2009
Ruby on Rails


                               Proxy Reverso
                                                      Mongrel
                        http         /         http    Rails
                               Load Balancer




Monday, March 2, 2009
Ruby on Rails

                                                      Mongrel
                                               http    Rails


                               Proxy Reverso          Mongrel
                        http         /         http    Rails
                               Load Balancer


                                                      Mongrel
                                               http
                                                       Rails




Monday, March 2, 2009
JRuby on Rails
                                  container




                        http     Servlet




Monday, March 2, 2009
JRuby on Rails
                                         container

                               Thread

                               Thread

                               Thread
                        http            Servlet

                               Thread

                               Thread




Monday, March 2, 2009
JRuby on Rails
                                         container

                               Thread

                               Thread

                                                       Rails
                               Thread
                        http            Servlet
                                                     (JRuby)

                               Thread

                               Thread




Monday, March 2, 2009
JRuby on Rails
                                         container

                                                       Rails
                               Thread
                                                     (JRuby)
                               Thread

                                                       Rails
                               Thread
                        http            Servlet
                                                     (JRuby)

                               Thread

                                                       Rails
                               Thread
                                                     (JRuby)




Monday, March 2, 2009
JRuby on Rails
                                                      container

                                                                    Rails
                                     Thread
                                                                  (JRuby)
                                     Thread


                        Goldspike                                   Rails
                                     Thread
                        http                        Servlet
                                                                  (JRuby)
                           http://wiki.jruby.org/wiki/Goldspike
                                      Thread

                                                                    Rails
                                     Thread
                                                                  (JRuby)




Monday, March 2, 2009
JRuby Rack

                                                             Rails
                                 Thread             rack
                                                           (JRuby)
                                 Thread
                                          Filter
                                                             Rails
                                 Thread
                        http              Servlet   rack
                                           JRuby           (JRuby)
                                            Rack
                                 Thread

                                                             Rails
                                 Thread             rack
                                                           (JRuby)




Monday, March 2, 2009
JRuby Rack

                                                                    Rails
                                   Thread                  rack
                                                                  (JRuby)
                                   Thread


                                Merb?
                                                  Filter
                                                                    Rails
                                   Thread
                        http                     Servlet   rack
                                                  JRuby           (JRuby)
                                                   Rack
                                http://merbivore.com/
                                   Thread

                                                                    Rails
                                   Thread                  rack
                                                                  (JRuby)




Monday, March 2, 2009
I agree, the
                        memory situation
                         is not the best




                                                but compared to
                                          MRI, JRuby deployments are
                                        actually favorable. We're seeing
                                        around 20MB per runtime
                                             in our deployment, ...




    http://www.flickr.com/photos/nicksieger
Monday, March 2, 2009
Rails 2.2 is

                 thread-safe!




             http://joshpeek.com/
Monday, March 2, 2009
-server -Xmx1024m

            httperf --num-conns 100 --rate 10


         class HomeController < ApplicationController
           def index
             render :text =>
               quot;<html>fibonnaci(29) = #{fibonacci(29)}</html>quot;
           end

           private
           def fibonacci(number)
             return number if number < 2
             fibonacci(number - 1) + fibonacci(number - 2)
           end
         end


Monday, March 2, 2009
Tomcat
                  1 runtime, thread-safe: 176 MB
                       3 runtimes: 200 MB
                       5 runtimes: 244 MB

                                              Jetty
                                   1 runtime, thread-safe: 193 MB
                                        3 runtimes: 204 MB
                                        5 runtimes: 245 MB

                        Glassfish
     1 runtime, thread-safe: 315 MB
          3 runtimes: 370 MB
          5 runtimes: 417 MB
Monday, March 2, 2009
jruby -S gem install mongrel
     cd railsapp
     jruby script/server


                        Glassfish v3 (gem)
                        http://wiki.jruby.org/wiki/JRuby_on_Rails_in_GlassFish



     jruby -S gem install glassfish
     jruby -S glassfish

Monday, March 2, 2009
Warbler
                        http://wiki.jruby.org/wiki/Warbler




                jruby -S gem install warbler
                cd railsapp
                jruby -S warble




Monday, March 2, 2009
Monday, March 2, 2009
jruby -S gem install jetty-rails
         cd railsapp
         jruby -S jetty_rails




                        http://jetty-rails.rubyforge.org/
Monday, March 2, 2009
Eu ouvi dizer
                        que Jruby é
                          lento!




Monday, March 2, 2009
Monday, March 2, 2009
httperf --num-conns 2500 --rate 25




            guj2: ~20 resp/s


Monday, March 2, 2009
httperf --num-conns 8000 --rate 140




Monday, March 2, 2009
httperf --num-conns 8000 --rate 140




         guj3: ~140 resp/s

                                                              vs 20 resp/s
Monday, March 2, 2009
“como?”
Monday, March 2, 2009
Cache!



Monday, March 2, 2009
Cache!
                                   container
                          Rails
                        (JRuby)          Servlet Context

                                       fragmento
                                                   fragmento
                          Rails      fragmento
                                          fragmento
                        (JRuby)
                                                   fragmento
                                       fragmento
                                                   fragmento
                                     fragmento
                          Rails
                        (JRuby)




Monday, March 2, 2009
Conexões ao banco



Monday, March 2, 2009
Mongrel
                         http    Rails



                                Mongrel
                         http    Rails


         Proxy Reverso          Mongrel
               /         http    Rails
         Load Balancer


                                Mongrel
                         http    Rails



                                Mongrel
                         http    Rails

Monday, March 2, 2009
Mongrel
                         http    Rails



                                Mongrel
                         http    Rails


         Proxy Reverso          Mongrel
               /         http    Rails


                            Pool?
         Load Balancer


                                Mongrel
                         http    Rails



                                Mongrel
                         http    Rails

Monday, March 2, 2009
JRuby
                                            Connection Pool
                        Runtime



                         JRuby
                        Runtime


                                   JDBC
                         JRuby
       JRuby Rack                 Adapter
                        Runtime
          Filter                   (jndi)


                         JRuby
                        Runtime



                         JRuby
                        Runtime

Monday, March 2, 2009
“”             Não importa a tecnologia,




Monday, March 2, 2009
“”             Não importa a tecnologia,
        desde que você a
      conheça muito bem!
Monday, March 2, 2009
+

Monday, March 2, 2009
http://code.google.com/p/activehibernate/


  class Person
    include Hibernate
    primary_key_accessor :id, :long
    h_component :address, [[:street,:string], [:city,:string]]
  end


Monday, March 2, 2009
No. Ribs!

      class Blog
        Ribs! :table => :fox_blog do |r|
          r.id.primary_key!
          r.title :column => :blog_title
          r.body :column => :content_text

          r.something.avoid!
        end
      end

Monday, March 2, 2009
Spring
    <beans xmlns=quot;...quot;>
      <lang:jruby id=quot;messageServicequot;
                  script-interfaces=quot;br.com.caelum.Messengerquot;
                  script-source=quot;classpath:ruby_messenger.rbquot;>
        <lang:property name=quot;messagequot; value=quot;Hello World!quot;/>
      </lang:jruby>

      <bean id=quot;businessLogicquot; class=quot;br.com.caelum.Logicquot;>
        <constructor-arg ref=quot;messageServicequot; />
      </bean>
    </beans>




Monday, March 2, 2009
MagLev




Monday, March 2, 2009
(J)MagLev




Monday, March 2, 2009
Dúvidas?




                                               Obrigado!


                        fabio.kung@caelum.com.br
Monday, March 2, 2009

Contenu connexe

Similaire à JRuby on Rails

iPod iLearn
iPod iLearniPod iLearn
iPod iLearnjjash
 
RefreshPhilly Presentation February 09
RefreshPhilly Presentation February 09RefreshPhilly Presentation February 09
RefreshPhilly Presentation February 09Johnny Bilotta
 
Carrington CMS Theme Framework for WordPress
Carrington CMS Theme Framework for WordPressCarrington CMS Theme Framework for WordPress
Carrington CMS Theme Framework for WordPressalexkingorg
 
Internationalization of your homepage
Internationalization of your homepageInternationalization of your homepage
Internationalization of your homepagegutskun
 
OpenID DrupalCon 2009
OpenID DrupalCon 2009OpenID DrupalCon 2009
OpenID DrupalCon 2009James Walker
 
Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Bart De Waele
 
Ruby On Rails Presentation Barcamp Antwerp.Key
Ruby On Rails Presentation Barcamp Antwerp.KeyRuby On Rails Presentation Barcamp Antwerp.Key
Ruby On Rails Presentation Barcamp Antwerp.KeyBert Goethals
 
Building Apis That Rock
Building Apis That RockBuilding Apis That Rock
Building Apis That RockJeff Eaton
 
Speak To Win08(No Video)
Speak To Win08(No Video)Speak To Win08(No Video)
Speak To Win08(No Video)NarrativePros
 

Similaire à JRuby on Rails (11)

Desk To Mobile
Desk To MobileDesk To Mobile
Desk To Mobile
 
iPod iLearn
iPod iLearniPod iLearn
iPod iLearn
 
RefreshPhilly Presentation February 09
RefreshPhilly Presentation February 09RefreshPhilly Presentation February 09
RefreshPhilly Presentation February 09
 
Carrington CMS Theme Framework for WordPress
Carrington CMS Theme Framework for WordPressCarrington CMS Theme Framework for WordPress
Carrington CMS Theme Framework for WordPress
 
Internationalization of your homepage
Internationalization of your homepageInternationalization of your homepage
Internationalization of your homepage
 
OpenID DrupalCon 2009
OpenID DrupalCon 2009OpenID DrupalCon 2009
OpenID DrupalCon 2009
 
Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?Web2.0 - wat is dat beest?
Web2.0 - wat is dat beest?
 
Ruby On Rails Presentation Barcamp Antwerp.Key
Ruby On Rails Presentation Barcamp Antwerp.KeyRuby On Rails Presentation Barcamp Antwerp.Key
Ruby On Rails Presentation Barcamp Antwerp.Key
 
Building Apis That Rock
Building Apis That RockBuilding Apis That Rock
Building Apis That Rock
 
Communicatie 2.0
Communicatie 2.0Communicatie 2.0
Communicatie 2.0
 
Speak To Win08(No Video)
Speak To Win08(No Video)Speak To Win08(No Video)
Speak To Win08(No Video)
 

Plus de Fabio Kung

DockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containersDockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containersFabio Kung
 
Linux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentLinux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentFabio Kung
 
Dicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudDicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudFabio Kung
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionFabio Kung
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Fabio Kung
 
Cloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoCloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoFabio Kung
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o CloudFabio Kung
 
Storage para virtualização
Storage para virtualizaçãoStorage para virtualização
Storage para virtualizaçãoFabio Kung
 
Automacao devops
Automacao devopsAutomacao devops
Automacao devopsFabio Kung
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e RubyFabio Kung
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Fabio Kung
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivoFabio Kung
 
SOA não precisa ser buzzword
SOA não precisa ser buzzwordSOA não precisa ser buzzword
SOA não precisa ser buzzwordFabio Kung
 

Plus de Fabio Kung (13)

DockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containersDockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containers
 
Linux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentLinux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environment
 
Dicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudDicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no Cloud
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!
 
Cloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoCloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como Serviço
 
Usando o Cloud
Usando o CloudUsando o Cloud
Usando o Cloud
 
Storage para virtualização
Storage para virtualizaçãoStorage para virtualização
Storage para virtualização
 
Automacao devops
Automacao devopsAutomacao devops
Automacao devops
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e Ruby
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivo
 
SOA não precisa ser buzzword
SOA não precisa ser buzzwordSOA não precisa ser buzzword
SOA não precisa ser buzzword
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

JRuby on Rails

  • 1. JRuby on Rails fabio.kung@caelum.com.br Monday, March 2, 2009
  • 4. DSLs Externa Interna (host) Monday, March 2, 2009
  • 5. HAPPY INTERNATIONAL INVOKEDYNAMIC DAY JSR-292 http://openjdk.java.net/projects/mlvm/ Monday, March 2, 2009
  • 7. Mas e por que Java? “por que?” Monday, March 2, 2009
  • 8. Memória Heap objeto objeto objeto objeto objeto objeto objeto Monday, March 2, 2009
  • 9. Memória Heap objeto objeto objeto objeto objeto objeto objeto Monday, March 2, 2009
  • 10. Memória Heap objeto objeto objeto objeto objeto objeto objeto Monday, March 2, 2009
  • 11. Memória Heap objeto objeto objeto objeto objeto objeto objeto Monday, March 2, 2009
  • 12. Memória Heap objeto objeto objeto objeto objeto objeto objeto Monday, March 2, 2009
  • 13. 95% dos objetos tem vida curta Monday, March 2, 2009
  • 14. Mortalidade Infantil Memória Heap Eden Tenured Monday, March 2, 2009
  • 15. Mortalidade Infantil Memória Heap Eden Tenured Monday, March 2, 2009
  • 16. Mortalidade Infantil Memória Heap Eden Tenured objeto objeto objeto objeto Monday, March 2, 2009
  • 17. Mortalidade Infantil Memória Heap Eden Tenured objeto objeto objeto objeto Monday, March 2, 2009
  • 18. Mortalidade Infantil Memória Heap Eden Tenured objeto objeto objeto objeto Monday, March 2, 2009
  • 19. Flexibilidade • Serial • ParNew • Parallel Scavenge • Serial Old • CMS • Parallel Old • G1 http://blogs.sun.com/jonthecollector/entry/our_collectors Monday, March 2, 2009
  • 20. Ea performance? Monday, March 2, 2009
  • 21. http://headius.blogspot.com/2008/02/jruby-rc2-released-whats-next.html JRuby's performance regularly exceeds Ruby 1.8.6, and in many cases has started to exceed Ruby 1.9 http://www.flickr.com/photos/diathesis/2115578333/ Monday, March 2, 2009
  • 23. Startup • -X:bootclasspath • Nailgun: http://www.martiansoftware.com/nailgun/ Monday, March 2, 2009
  • 24. Startup • -X:bootclasspath • Nailgun: http://www.martiansoftware.com/nailgun/ Nailgun tcp/ip Client Nailgun tcp/ip JVM Server Client Nailgun tcp/ip Client Monday, March 2, 2009
  • 25. Rails não escala! Monday, March 2, 2009
  • 26. http://www.akitaonrails.com/2008/4/19/di-rio-de-bordo-do-fisl-9 Sim! Rails escala! http://picasaweb.google.com/leo.torres84/FISL2008 Monday, March 2, 2009
  • 27. Ruby on Rails http WebServer Rails CGI “como?” Monday, March 2, 2009
  • 28. Ruby on Rails Rails CGI http WebServer Rails CGI CGI Rails “como?” Monday, March 2, 2009
  • 29. Ruby on Rails Proxy Reverso Mongrel http / http Rails Load Balancer Monday, March 2, 2009
  • 30. Ruby on Rails Mongrel http Rails Proxy Reverso Mongrel http / http Rails Load Balancer Mongrel http Rails Monday, March 2, 2009
  • 31. JRuby on Rails container http Servlet Monday, March 2, 2009
  • 32. JRuby on Rails container Thread Thread Thread http Servlet Thread Thread Monday, March 2, 2009
  • 33. JRuby on Rails container Thread Thread Rails Thread http Servlet (JRuby) Thread Thread Monday, March 2, 2009
  • 34. JRuby on Rails container Rails Thread (JRuby) Thread Rails Thread http Servlet (JRuby) Thread Rails Thread (JRuby) Monday, March 2, 2009
  • 35. JRuby on Rails container Rails Thread (JRuby) Thread Goldspike Rails Thread http Servlet (JRuby) http://wiki.jruby.org/wiki/Goldspike Thread Rails Thread (JRuby) Monday, March 2, 2009
  • 36. JRuby Rack Rails Thread rack (JRuby) Thread Filter Rails Thread http Servlet rack JRuby (JRuby) Rack Thread Rails Thread rack (JRuby) Monday, March 2, 2009
  • 37. JRuby Rack Rails Thread rack (JRuby) Thread Merb? Filter Rails Thread http Servlet rack JRuby (JRuby) Rack http://merbivore.com/ Thread Rails Thread rack (JRuby) Monday, March 2, 2009
  • 38. I agree, the memory situation is not the best but compared to MRI, JRuby deployments are actually favorable. We're seeing around 20MB per runtime in our deployment, ... http://www.flickr.com/photos/nicksieger Monday, March 2, 2009
  • 39. Rails 2.2 is thread-safe! http://joshpeek.com/ Monday, March 2, 2009
  • 40. -server -Xmx1024m httperf --num-conns 100 --rate 10 class HomeController < ApplicationController def index render :text => quot;<html>fibonnaci(29) = #{fibonacci(29)}</html>quot; end private def fibonacci(number) return number if number < 2 fibonacci(number - 1) + fibonacci(number - 2) end end Monday, March 2, 2009
  • 41. Tomcat 1 runtime, thread-safe: 176 MB 3 runtimes: 200 MB 5 runtimes: 244 MB Jetty 1 runtime, thread-safe: 193 MB 3 runtimes: 204 MB 5 runtimes: 245 MB Glassfish 1 runtime, thread-safe: 315 MB 3 runtimes: 370 MB 5 runtimes: 417 MB Monday, March 2, 2009
  • 42. jruby -S gem install mongrel cd railsapp jruby script/server Glassfish v3 (gem) http://wiki.jruby.org/wiki/JRuby_on_Rails_in_GlassFish jruby -S gem install glassfish jruby -S glassfish Monday, March 2, 2009
  • 43. Warbler http://wiki.jruby.org/wiki/Warbler jruby -S gem install warbler cd railsapp jruby -S warble Monday, March 2, 2009
  • 45. jruby -S gem install jetty-rails cd railsapp jruby -S jetty_rails http://jetty-rails.rubyforge.org/ Monday, March 2, 2009
  • 46. Eu ouvi dizer que Jruby é lento! Monday, March 2, 2009
  • 48. httperf --num-conns 2500 --rate 25 guj2: ~20 resp/s Monday, March 2, 2009
  • 49. httperf --num-conns 8000 --rate 140 Monday, March 2, 2009
  • 50. httperf --num-conns 8000 --rate 140 guj3: ~140 resp/s vs 20 resp/s Monday, March 2, 2009
  • 53. Cache! container Rails (JRuby) Servlet Context fragmento fragmento Rails fragmento fragmento (JRuby) fragmento fragmento fragmento fragmento Rails (JRuby) Monday, March 2, 2009
  • 54. Conexões ao banco Monday, March 2, 2009
  • 55. Mongrel http Rails Mongrel http Rails Proxy Reverso Mongrel / http Rails Load Balancer Mongrel http Rails Mongrel http Rails Monday, March 2, 2009
  • 56. Mongrel http Rails Mongrel http Rails Proxy Reverso Mongrel / http Rails Pool? Load Balancer Mongrel http Rails Mongrel http Rails Monday, March 2, 2009
  • 57. JRuby Connection Pool Runtime JRuby Runtime JDBC JRuby JRuby Rack Adapter Runtime Filter (jndi) JRuby Runtime JRuby Runtime Monday, March 2, 2009
  • 58. “” Não importa a tecnologia, Monday, March 2, 2009
  • 59. “” Não importa a tecnologia, desde que você a conheça muito bem! Monday, March 2, 2009
  • 61. http://code.google.com/p/activehibernate/ class Person include Hibernate primary_key_accessor :id, :long h_component :address, [[:street,:string], [:city,:string]] end Monday, March 2, 2009
  • 62. No. Ribs! class Blog Ribs! :table => :fox_blog do |r| r.id.primary_key! r.title :column => :blog_title r.body :column => :content_text r.something.avoid! end end Monday, March 2, 2009
  • 63. Spring <beans xmlns=quot;...quot;> <lang:jruby id=quot;messageServicequot; script-interfaces=quot;br.com.caelum.Messengerquot; script-source=quot;classpath:ruby_messenger.rbquot;> <lang:property name=quot;messagequot; value=quot;Hello World!quot;/> </lang:jruby> <bean id=quot;businessLogicquot; class=quot;br.com.caelum.Logicquot;> <constructor-arg ref=quot;messageServicequot; /> </bean> </beans> Monday, March 2, 2009
  • 66. Dúvidas? Obrigado! fabio.kung@caelum.com.br Monday, March 2, 2009

Notes de l'éditeur

  1. silver bullet escolher uma
  2. 2004, 2005, 2006, ...
  3. xml, html, css, js ferramenta certa, hora certa
  4. fragmenta&#xE7;&#xE3;o stop-the-world
  5. fragmenta&#xE7;&#xE3;o stop-the-world
  6. fragmenta&#xE7;&#xE3;o stop-the-world
  7. fragmenta&#xE7;&#xE3;o stop-the-world
  8. fragmenta&#xE7;&#xE3;o stop-the-world
  9. fragmenta&#xE7;&#xE3;o stop-the-world
  10. fragmenta&#xE7;&#xE3;o stop-the-world
  11. fragmenta&#xE7;&#xE3;o stop-the-world
  12. fragmenta&#xE7;&#xE3;o stop-the-world
  13. produtividade aposta fun
  14. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  15. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  16. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  17. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  18. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  19. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  20. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  21. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  22. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  23. + r&#xE1;pido compacta&#xE7;&#xE3;o adaptatividade
  24. funcionalidades
  25. jruby &#xE9; o + r&#xE1;pido
  26. CGI: processo por request FCGI: pool
  27. CGI: processo por request FCGI: pool
  28. CGI: processo por request FCGI: pool
  29. CGI: processo por request FCGI: pool
  30. CGI: processo por request FCGI: pool
  31. CGI: processo por request FCGI: pool
  32. http share-nothing mongrel per request 30Mb-80Mb
  33. http share-nothing mongrel per request 30Mb-80Mb
  34. http share-nothing mongrel per request 30Mb-80Mb
  35. http share-nothing mongrel per request 30Mb-80Mb
  36. http share-nothing mongrel per request 30Mb-80Mb
  37. http share-nothing mongrel per request 30Mb-80Mb
  38. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  39. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  40. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  41. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  42. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  43. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  44. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  45. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  46. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  47. concorrencia desde 97 share nothing? cache, session, jndi distribuido vai para terracotta, jboss tree, memcached
  48. protocolo leve filter desacopla o fw web rails requer bastante mem&#xF3;ria
  49. sem feedback instant&#xE2;neo
  50. glassfish_gem