Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Switch to Puma for web server instead of Thin #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Dec 9, 2012

  1. Switch to Puma for web server instead of Thin

    Sinatra prior to 1.3 uses "EventMachine" mode of Thin, which disables
    Ruby
    threading. This can dramatically decrease throughput on JRuby and
    Rubinius, because it cannot take advantage of multiple CPU cores with
    this configuration.
    
    In addition, the MRI (Matz Ruby Implementation) C version of Ruby has a
    pattern where it will not block on IO if threading is used, because IO
    will run in the background concurrently while work is being done on
    other threads.
    
    Unfortunately, Thin with Sinatra < 1.3 forcibly turns threading off due
    to EventMachine, which makes it so the server has to stop and wait for
    external IO requests to finish until it can continue serving content
    (the
    exception being if you use the special EventMachine drivers, which are
    very difficult to implement).
    
    Puma does not have these restrictions. It is a fast, clean
    implementation based on threads, and should run well on all Ruby
    implementations. It should increase throughput dramatically vs Thin for
    sites doing a lot of remote IO. It also has a lot of power features like
    HTTP Keepalive. And best of all, it removes the EventMachine dependency!
    
    More information is available from their web site: http://puma.io
    kyledrake committed Dec 9, 2012
    Configuration menu
    Copy the full SHA
    3ea0651 View commit details
    Browse the repository at this point in the history