5

JRuby with Nick Sieger

 4 years ago
source link: https://www.devroom.io/2008/09/02/jruby-with-nick-sieger/?utm_campaign=Feed%3A+ariejan+%28ariejan%7Cdevroom.io%29
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

JRuby with Nick Sieger

Posted: 2008-09-02 - Last updated: 2019-06-05

Tagged general railsconfeurope2008 jruby nicksieger

A tutorial on JRuby with Nick Sieger holding your hand is just great. This guy knows JRuby inside-out and he has an answer to even the most difficult of questions.

After a short 15 minute introduction, Nick left us with our Rails app to start it with JRuby on a mongrel. I’ve been toying around with JRuby a bit before, and this was rather easy. Some people, however, encounter some issues with their apps because of incompatible gems, like OpenSSL or RMagic which are not available for the Java platform. Luckily, there are some nice Java alternatives like JRuby OpenSSL and ImageVooDoo. My app didn’t suffer from these issues, but from what I’ve heard, these alternatives work great.

Next for the big work: creating a WAR file and deploying it. I’ve done this before, and it’s dead easy. In stall the Warble gem, warble your Rails app and deploy the resulting WAR file.

Nick also talked about the differences between using the JVM and Unix. The biggest differences are memory management and the creation of new threads/processes.

There are quite a few things that Rails and a Java app server have in common, like logging and session handling. In his sheets (I’ll link to those later), you can see how you can tune your Rails app to make use of these features and improve your apps performance (by not logging and keeping sessions in two different places).

Continuing on the performance of Glassfish/JRuby, Nick shows several graphs on how well JRuby performs. A lot of attention goes to Rails 2.2, which will be thread-safe and what it means for JRuby.

JRuby can run with 1 runtime and fill your CPU with threads to handle requests using native Java threads. To handle database connections, Nick Sieger has written a connection pooling component for ActiveRecord (to prevent every thread having it’s own connection to your database). An unreleased version of warbler was distributed that will allow you to set max_instances to 1. This will create 1 Rails instance and use threading in Glassfish. Of course, this is only useful with Rails 2.2.

This was altogether a great tutorial afternoon. Besides the basic warble-your-app-and-deploy-it, Nick provided a lot of interesting facts and tips about deploying to Glassfish. I already was enthusiastic about JRuby, but now I really have to get my hands on a decent server that will run Glassfish comfortably. This means at least at least 1Gb of RAM, so I think I have found at least one drawback of using JRuby.


Recommend

  • 59
    • www.tuicool.com 6 years ago
    • Cache

    Connect to Snowflake Data in JRuby

    JRuby is a high-performance, stable, fully-threaded Java implementation of the Ruby programming language. The CData JDBC Driver for Snowflake makes it easy to integrate connectivity to live Snowflake data in JRuby. This a...

  • 11

    Async Interview #1: Alex and Nick talk about async I/O and WebAssembly Nov 28, 2019 Hello from Iceland! (I’m on vacation.) I’ve just uploaded the first of the Async Interv...

  • 19

    Functions of Matrices: Theory and Computation by Nicholas J. Higham, SIAM, 2008. xx+425 pages, hardcover, ISBN 978-0-898716-46-7. Published March 27, 2008.

  • 13

    We just released AppSignal for Ruby gem version 2.8.0 which improves memory host metrics reporting on containers, supports JRuby on Alpine Linux and improves the diagnostics reports we...

  • 14
    • blog.appsignal.com 4 years ago
    • Cache

    Ruby gem 2.5 - JRuby support!

    We just released AppSignal for Ruby gem version 2.5 which adds support for JRuby! JRuby was previously only available in Ruby gem versions 0.11.18 and lower. Thanks to a recent...

  • 7
    • www.devroom.io 4 years ago
    • Cache

    JRuby with Thomas Enebo

    JRuby with Thomas Enebo Posted: 2008-09-03 - Last updated: 2019-06-05 Tagged

  • 5
    • developer.squareup.com 3 years ago
    • Cache

    Maven, Gems, and a JRuby Console for All

    July 2nd, 2013 | 4 minute readMaven, Gems, and a JRuby Console for AllWe will show how to add a JRuby console to any maven project… with gems!

  • 6
    • developer.squareup.com 3 years ago
    • Cache

    Using Java Protocol Buffers in JRuby

    June 27th, 2013 | 4 minute readUsing Java Protocol Buffers in JRubySquare communicates between services using Protocol Buffers. These binary formats are great for documenting API’s, small on the wire, and, with a little w...

  • 5
    • developer.squareup.com 3 years ago
    • Cache

    JRuby at Square

    June 25th, 2013 | 2 minute readJRuby at SquareThe first of a series of posts highlighting discoveries and insights found while integrating Ruby with our robust Java stack.

  • 8

    appsignalRuby gem 2.8 - Container memory & JRuby on Alpine Linux support

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK