small medium large xlarge

Deploying with JRuby 9k: Deliver Scalable Web Apps Using the JVM


Cover image for Deploying with JRuby 9k

Deploying with JRuby 9k

Deliver Scalable Web Apps Using the JVM


Deploy using the JVM’s high performance while building your apps in the language you love. This book introduces you to three JRuby deployment strategies that give you the performance and scalability you need, while you use a language designed for rapid development. Explore common deployment scenarios, including consolidating an MRI-based Ruby deployment onto a single JVM process and porting a Rails application to JRuby, getting it into production, and keeping it running. This new edition has new chapters on Puma, performance tuning, and Java integration, and is updated to the latest versions of JRuby 9k, Rails 4, and JDK 8.

Customer Reviews

Joe has pulled together a great collection of deployment knowledge from his years
of experience building and supporting JRuby applications. He’s an expert on this
subject and Deploying with JRuby 9k is the definitive text for getting JRuby applications
up and running.

- Charles Oliver Nutter

JRuby co-lead

Deploying with JRuby 9k answers the most frequently asked questions about realworld
use of JRuby. Whether you’re coming to JRuby from Ruby or Java, Joe fills
in all the gaps you’ll need to deploy JRuby with confidence.

- Tom Enebo

JRuby co-lead

I’ve been working with JRuby for years and I still learned several immediately
actionable steps to improve the performance and maintenance of real-world
JRuby apps.

- Matt Margolis

Director, application development at Getty Images

Deploying with JRuby 9k is full of practical and actionable advice about how to
get the most benefit out of the JVM when running your Ruby app on JRuby.

- Chris Seaton

Oracle Labs and JRuby contributor

Deploying with JRuby 9k is the essential guide for anyone building Ruby applications
on the JVM. It’s loaded with tips, tricks, and best practices that newcomers
and experts can learn from.

- Terence Lee

Ruby task force member at Heroku

As a developer of MRI, I get super jealous reading about the JVM ecosystem and
tooling. With this book, Joe has finally made that ecosystem approachable for
JRuby applications.

- Zachary Scott

Ruby-core member and maintainer of Sinatra

See All Reviews

What You Need

To run the examples in this book, you’ll need a computer that can run the Java Virtual Machine and a connection to the Internet.

Contents & Extracts

  • Acknowledgments
  • Preface
    • The No-Java-Code Promise
    • What’s in This Book?
    • What’s Not in This Book?
    • Who Is This Book For?
    • Conventions
    • Getting the Source Code
    • Online Resources
  • Getting Started with JRuby
  • Creating a Deployment Environment
    • Installing Docker
    • Getting Started with Docker
    • Creating a Docker Image
    • Deploying to the Cloud
    • Wrapping Up
  • Deploying a Rails Application
    • What Is Traditional Deployment?
    • Porting to JRuby
    • Configuring Rails for Production
    • Creating the Deployment Environment
    • Deploying to the Public Cloud
    • Deploying to Private Infrastructure
    • Wrapping Up
  • Consuming Backing Services with JRuby
  • Deploying JRuby in the Enterprise
    • What Is an Application Server?
    • Getting Started with TorqueBox
    • Scheduling a Recurring Job
    • Using the Cache
    • Deploying to the Public Cloud
    • Deploying to Private Infrastructure
    • Using a Commercially Supported Server
    • Wrapping Up
  • Managing a JRuby Application
    • Creating a Memory Leak
    • Inspecting the Runtime with VisualVM
    • Inspecting the Runtime with JMX
    • Invoking MBeans Programmatically
    • Creating a Management Bean
    • Using the JRuby Profiler
    • Analyzing a Heap Dump
    • Wrapping Up
  • Tuning a JRuby Application
    • Setting the Heap Size
    • Setting Metaspace size
    • Configuring Heap Generations
    • Choosing a Garbage Collector
    • Benchmarking the Garbage Collector
    • Using invokedynamic
    • Wrapping Up
  • Monitoring JRuby in Production
    • Installing the New Relic Gem
    • Creating a New Relic Alert
    • Handling Errors with Rollbar
    • Customizing Rollbar Reporting
    • Wrapping Up
  • Using a Continuous Integration Server
    • Installing Jenkins
    • Installing Jenkins Plugins
    • Creating a Git Depot
    • Creating a Jenkins Job
    • Enabling Continuous Delivery
    • Wrapping Up


Joe Kutner has been building JRuby applications since 2007 for clients including IBM and NASA. Today, he is the JVM Platform Owner at Heroku, a Platform as a Service support for JRuby and Rails. Joe also contributes to several JRuby projects, including Warbler and Torquebox.