Engine Yard Developer Center

Use Puma with Engine Yard Cloud

Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. If you are writing a simple REST API application that is expected to receive a large amount of small requests, or long polling requests, Puma offers higher performance than Passenger or Unicorn with the Engine Yard Cloud default configuration. Passenger and Unicorn are however recommended to be used in multiple-application environments rather than Puma.

Puma can be used with any app that supports Rack, and is considered the replacement for Webrick and Mongrel, it also works well with MRI. Puma is intended for use in both development and production environments and, as of Rails 5, Puma has become the default development web server.

Engine Yard does support Puma on stack v5.

Important: Currently there is a known issue when using Puma with Engine Yard. If your application repository contains a config/puma.rb file, it will override the Puma configuration generated by the Engine Yard platform and may prevent your application from successfully spawning Puma workers. For more information, please see the config/puma.rb Overwrites Engine Yard Configuration Options article.

 

Get started with Puma

This document describes how to use Puma in the Engine Yard Cloud environment:

Install Puma locally

You can install Puma on your development machine to test locally.

To install Puma locally using RubyGems

  1. Download Puma from http://rubygems.org/gems/puma.

    From the command line:

    $ gem install puma

    Puma command is now available in your PATH.

  2. In the root folder of your Rack app:

    $ puma app.ru

    This starts your Rack app using Puma, with app.ru as your app config file.

To install Puma using Bundler

  1. Ensure Puma is in your Gemfile:

    $ gem 'puma'
  2. Run the command:

    $ bundle install
  3. Start your Puma server:

    $ bundle exec puma
  4. Commit the Gemfile and the Gemfile.lock to your repo.

Use Puma in your environment

You can use Puma in an existing app environment or a new environment. If you want to use Puma in an existing environment, you'll need to stop the environment to edit it.

Notes:

  • Your Application Type must be Rack or Rails.
  • Be sure the Puma gem is bundled into your repo (see Install Puma locally).

To use Puma in a new environment

  1. Create a new environment using the Create an environment link on your application.

  2. Select stable-v5 as the Stack version.
  3. Select Puma for the Application Server Stack.

  4. Select the other environment options as appropriate. See Create an Environment for more information.

  5. Click Create the Environment.

  6. Click Boot This Configuration.

To use Puma in an existing environment

  1. Stop the environment.

  2. On the Environment page, click Edit Environment.

  3. Select stable-v5 as the Stack version.  If the environment was running an older version of the stack and already had custom recipes uploaded, more likely they will not work.  Open a ticket with Engine Yard Support for further guidance.
  4. Select Puma for the Application Server Stack.

  5. Select the other environment options as appropriate. See Create an Environment for more information.

  6. Click Update Environment.

  7. Click Boot, then Boot This Configuration.

More Information

For more information about ... See ...
Puma website http://puma.io/
Puma on GitHub https://github.com/puma/puma
Puma on RubyGems.org http://rubygems.org/gems/puma

If you have feedback or questions about this page, add a comment below. If you need help, submit a ticket with Engine Yard Support.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    Kjell Morgenstern

    I am trying to enable puma, but it is not listed in the early features (2017-04-17).

Please sign in to leave a comment.

Powered by Zendesk