Deploy, Scale and
Sleep at Night
with JRuby
@codefinger
Deploy, Scale and
Sleep at Night
                Ruby on
with JRuby
@codefinger     the JVM
java_import “java.io.File”


 Java::JavaLang::String
you
sysadmin




you
$ cap deploy




                     sysadmin




you
CPU$                                              RAM$
120"

100"

 80"

 60"

 40"

 20"

  0"
       1" 2" 3" 4" 5" 6" 7" 8" 9" 10" 11" 12" 13" 14" 15" 16" 17" 18" 19" 20" 21" 22"
HTTP
            Request




          Apache/Nginx




 MRI                      MRI

Mongrel                  Mongrel
Ruby     Ruby     Ruby
Thread   Thread   Thread




          GIL




         Kernel
         Thread
HTTP
          Request




        Apache/Nginx




            JVM




JRuby
                       Thread
http://torquebox.org/news/2011/10/06/torquebox-2x-performance/
1) JRuby...
2) ?
3) Profit!
1) JRuby...
2) Deployment
3) Profit!
JRuby

  Archive File

  Capistrano

Background Jobs

   Clustering

     PaaS
Warbler           Trinidad        TorqueBox

Archive File     Archive File      Archive File

                 Capistrano        Capistrano

               Background Jobs   Background Jobs

                                    Clustering

   PaaS             PaaS              PaaS
Warbler
$ gem install warbler

$ warble war




     WA
        R   File
$ apt-get install tomcat6




                        WA
                           R   File
$ apt-get install tomcat6




/var/lib/tomcat6
|-- common/
|-- conf/
                        WA
|-- logs/                  R   File
|-- shared/
|-- webapps/
`-- work/
Warbler
              + Tomcat/Jetty/WebLogic/JBoss


                                Tomcat/Jetty
                                  Server

WA                SSH/FTP/SMB
   R   File
Warbler
              + Tomcat/Jetty/WebLogic/JBoss


                                 Tomcat/Jetty
                                   Server

WA                SSH/FTP/SMB
   R   File



WA                 SSH/FTP/SMB
   R   File
Trinidad

$ gem install trinidad



$ rails s trinidad
Trinidad
                             Trinidad Server


app1/                                  Extensions
|-- app/
|-- config/
|-- db/         Capistrano
|-- lib/                               Job Scheduler (Quartz)
`-- config.ru



                                          Background Jobs
app2/                                        (Resque)
|-- app/
|-- config/
|-- db/         Capistrano
                                            DB Pool
|-- lib/
`-- config.ru                           (Commons DBCP)
TorqueBox
$ gem install torquebox-server

$ torquebox run


             then


$ torquebox deploy
TorqueBox
                              TorqueBox

                                       Job Scheduler
app1/
|-- app/
|-- config/
|-- db/          Capistrano               Messaging
|-- lib/
`-- config.ru
                                     Session Replication


                                      High Availability



    Knob                                   Services
                SSH/FTP/SMB
     File
                                          Stomplets


                                          Clustering
TorqueBox
            TorqueBox



TorqueBox               TorqueBox

             cluster

TorqueBox               TorqueBox



            TorqueBox
Other Options

• Mizuno
• Puma
Cloud
•   Heroku
•   EngineYard (Trinidad)
•   OpenShift (TorqueBox)
•   CloudBees (Warbler)
•   Google AppEngine
People

Processes
            Technologies
Text
              Text
               Text
                Text
                 Text
                  Text




http://pragprog.com/book/jkdepj
http://logichaus.com
The End
The End

Deploy, Scale and Sleep at Night with JRuby

Editor's Notes