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
-
Download Puma from http://rubygems.org/gems/puma.
From the command line:
$ gem install puma
Puma command is now available in your PATH.
-
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
-
Ensure Puma is in your Gemfile:
$ gem 'puma'
-
Run the command:
$ bundle install
-
Start your Puma server:
$ bundle exec puma
- 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
-
Create a new environment using the Create an environment link on your application.
- Select stable-v5 as the Stack version.
-
Select Puma for the Application Server Stack.
-
Select the other environment options as appropriate. See Create an Environment for more information.
-
Click Create the Environment.
-
Click Boot This Configuration.
To use Puma in an existing environment
-
Stop the environment.
-
On the Environment page, click Edit Environment.
- 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.
-
Select Puma for the Application Server Stack.
-
Select the other environment options as appropriate. See Create an Environment for more information.
-
Click Update Environment.
-
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.
Comments
Article is closed for comments.