background preloader

Ruby

Facebook Twitter

Puma vs Phusion Passenger · phusion/passenger Wiki. Puma is an open source multi-threaded application server for Ruby, written by Evan Phoenix and based on Mongrel. We at Phusion often get questions about how Puma differs from the Phusion Passenger Ruby web server. This article lists some differences. Regarding objectivity and accuracy As you may have noticed by now, this article is written by the authors of Phusion Passenger. Ease of use Phusion Passenger takes a holistic approach and acts more like an integrated whole. Puma acts more like a component that you have to integrate into the rest of the system.

License and price Puma is completely open source and free. Concurrency Puma is multithreaded-only. Multithreading allows less memory usage and provides higher concurrency than multi-process single-threading. Both Puma and Phusion Passenger Enterprise can be hybrid multi-process multi-threaded. Where Puma and Phusion Passenger Enterprise differ is the threading model. . [1] Only the case on MRI, not on JRuby and Rubinius. Management tools. Phusion Passenger design & architecture. 2.1. Overview Phusion Passenger’s architecture is a lot like model #2 described in Web application models. In other words, Phusion Passenger extends Apache/Nginx and allows it to act like an application server. This is shown in the following diagram: Phusion Passenger consists of: an Apache module, mod_passenger.

The module is active all Apache/Nginx processes. It should be noted that applications do not run in the same address space as the web server. 2.2. A very naive implementation of an application server would spawn an application process every time an HTTP request is received, just like CGI would. The first request to a Rails website will be slow, and subsequent requests will be fast. Both of these problems are very much solvable, and we’ve chosen to do just that. The first problem can be solved by preloading Rails applications, i.e. by running the Rails application before a request is ever made to that website. We spawn Rails applications via a spawn server. 2.3. The spawn manager. A Modern, Concurrent Web Server for Ruby - Puma. Passenger. Goliath. Goliath is an open source version of the non-blocking (asynchronous) Ruby web server framework powering PostRank.

It is a lightweight framework designed to meet the following goals: bare metal performance, Rack API and middleware support, simple configuration, fully asynchronous processing, and readable and maintainable code (read: no callbacks). The framework is powered by an EventMachine reactor, a high-performance HTTP parser and Ruby 1.9 runtime. One major major advantage Goliath has over other asynchronous frameworks is the fact that by leveraging Ruby fibers introduced in Ruby 1.9+, it can untangle the complicated callback-based code into a format we are all familiar and comfortable with: linear execution, which leads to more maintainable and readable code. Each Goliath request is executed in its own Ruby fiber and all asynchronous I/O operations can transparently suspend and later resume the processing without requiring the developer to write any additional code.

Install Goliath: Unicorn. Application_TimeoutsCONTRIBUTORSDESIGNFAQHACKINGISSUESKNOWN_ISSUESLICENSELinksNEWSPHILOSOPHYREADMESIGNALSSandboxTUNINGunicorn_1UnicornConfiguratorHttpServerOobGCPrereadInputStreamInputTeeInputUtilWorker unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients. Features Designed for Rack, Unix, fast clients, and ease-of-debugging.

We cut out everything that is better supported by the operating system, nginx or Rack.Compatible with Ruby 1.9.3 and later. unicorn 4.x remains supported for Ruby 1.8 users.Process management: unicorn will reap and restart workers that die from broken apps. License unicorn is copyright 2009-2016 by all contributors (see logs in git).

Install gem install unicorn Usage In APP_ROOT, run: Puma.