Unicorn (web server)

Last updated
Unicorn
Original author(s) Eric Wong
Developer(s) Unicorn developers
Initial releaseMarch 11, 2009;14 years ago (2009-03-11)
Stable release
6.1.0 [1]   OOjs UI icon edit-ltr-progressive.svg / 25 December 2021;2 years ago (25 December 2021)
Repository yhbt.net/unicorn/
Written in Ruby
Operating system Cross-platform
Available inEnglish
Type Web server
License GPLv2+ or Ruby 1.8
Website yhbt.net/unicorn/ OOjs UI icon edit-ltr-progressive.svg

Unicorn is a Rack HTTP server to serve Ruby web applications on UNIX environment. It is optimised to be used with nginx. It is based on now deprecated Mongrel 1.1.5 from 2008.

Contents

Architecture

Unicorn uses a master/worker architecture, where a master process forks worker processes and controls them. The application runs in a single thread. [2]

Reception and use

Unicorn was considered as “one of the most popular servers for Rails”. [3] [2]

Twitter started to test Unicorn in 2010. [4]

This server is shipped with Discourse. Their system administrator Sam Saffron noted Unicorn was reliable, as it reaps unresponsive workers. [5]

Unicorn inspired other projects like Gunicorn, a fork to run Python applications.

As of 2018, projects tend to favour Puma. [6] The Heroku hosting provider recommends since 2015 to migrate from Unicorn to Puma. [7] Deliveroo published a benchmark comparing the two servers and concluded “Puma performs better than Unicorn in all tests that were either heavily IO-bound or that interleaved IO and CPU work”, but that Unicorn was still slightly better performing in pure CPU situations. [8] GitLab switched to Puma from Unicorn in 2020. [9]

Related Research Articles

<span class="mw-page-title-main">Plan 9 from Bell Labs</span> Distributed operating system

Plan 9 from Bell Labs is a distributed operating system which originated from the Computing Science Research Center (CSRC) at Bell Labs in the mid-1980s and built on UNIX concepts first developed there in the late 1960s. Since 2000, Plan 9 has been free and open-source. The final official release was in early 2015.

lighttpd

lighttpd is an open-source web server optimized for speed-critical environments while remaining standards-compliant, secure and flexible. It was originally written by Jan Kneschke as a proof-of-concept of the c10k problem – how to handle 10,000 connections in parallel on one server, but has gained worldwide popularity. Its name is a portmanteau of "light" and "httpd".

<span class="mw-page-title-main">Ruby on Rails</span> Server-side open source web application framework

Ruby on Rails is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages. It encourages and facilitates the use of web standards such as JSON or XML for data transfer and HTML, CSS and JavaScript for user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), and the active record pattern.

<span class="mw-page-title-main">Benchmark (computing)</span> Comparing the relative performance of computers by running the same program on all of them

In computing, a benchmark is the act of running a computer program, a set of programs, or other operations, in order to assess the relative performance of an object, normally by running a number of standard tests and trials against it.

Mongrel is an open-source software HTTP library and web server written in Ruby by Zed Shaw. It is used to run Ruby web applications and presents a standard HTTP interface. This makes layering other servers in front of it possible using a web proxy, a load balancer, or a combination of both, instead of having to use more conventional methods employed to run scripts such as FastCGI or SCGI to communicate. This is made possible by integrating a custom high-performance HTTP request parser implemented using Ragel.


This is a comparison of notable free and open-source configuration management software, suitable for tasks like server configuration, orchestration and infrastructure as code typically performed by a system administrator.

The SPARC Enterprise series is a range of UNIX server computers based on the SPARC V9 architecture. It was co-developed by Sun Microsystems and Fujitsu, announced on June 1, 2004, and introduced in 2007. They were marketed and sold by Sun Microsystems, Fujitsu, and Fujitsu Siemens Computers under the common brand of "SPARC Enterprise", superseding Sun's Sun Fire and Fujitsu's PRIMEPOWER server product lines. Codename is APL.

Web server benchmarking is the process of estimating a web server performance in order to find if the server can serve sufficiently high workload.

Heroku is a cloud platform as a service (PaaS) supporting several programming languages. As one of the first cloud platforms, Heroku has been in development since June 2007, when it supported only the Ruby programming language, but now also supports Java, Node.js, Scala, Clojure, Python, PHP, and Go. For this reason, Heroku is said to be a polyglot platform as it has features for a developer to build, run and scale applications in a similar manner across most of these languages. Heroku was acquired by Salesforce in 2010 for $212 million.

Phusion Passenger is a free web server and application server with support for Ruby, Python and Node.js. It is designed to integrate into the Apache HTTP Server or the nginx web server, but also has a mode for running standalone without an external web server. Phusion Passenger supports Unix-like operating systems, and is available as a gem package, as a tarball, or as native Linux packages.

<span class="mw-page-title-main">Rack (web server interface)</span> API specification for web applications in programming language Ruby

Rack is a modular interface between web servers and web applications developed in the Ruby programming language. With Rack, application programming interfaces (APIs) for web frameworks and middleware are wrapped into a single method call handling HTTP requests and responses.

<span class="mw-page-title-main">Node.js</span> JavaScript runtime environment

Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more. Node.js runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.

JSGI, or JavaScript Gateway Interface, is an interface between web servers and JavaScript-based web applications and frameworks. It was inspired by the Rack for Ruby and WSGI for Python and was one of the inspirations of PSGI for Perl.

<span class="mw-page-title-main">Monit</span>

Monit is a free, open-source process supervision tool for Unix and Linux. With Monit, system status can be viewed directly from the command line, or via the native HTTP(S) web server. Monit is able to do automatic maintenance, repair, and run meaningful causal actions in error situations. Monit rose to popularity with Ruby on Rails and the Mongrel web server, because a tool was needed that could manage the many identical Mongrel processes that needed to be run to support a scalable Ruby on Rails site, and Monit was fairly uniquely suited for the needs of the Ruby on Rails community. Many popular Rails sites have used Monit, including Twitter and scribd.

<span class="mw-page-title-main">Gunicorn</span> Python web server

The Gunicorn "Green Unicorn" is a Python Web Server Gateway Interface (WSGI) HTTP server. It is a pre-fork worker model, ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with a number of web frameworks, simply implemented, light on server resources and fairly fast. It is often paired with Nginx, as the two have complementary features.

<span class="mw-page-title-main">RocksDB</span> Embedded key-value database

RocksDB is a high performance embedded database for key-value data. It is a fork of Google's LevelDB optimized to exploit multi-core processors (CPUs), and make efficient use of fast storage, such as solid-state drives (SSD), for input/output (I/O) bound workloads. It is based on a log-structured merge-tree data structure. It is written in C++ and provides official language bindings for C++, C, and Java. Many third-party language bindings exist. RocksDB is free and open-source software, released originally under a BSD 3-clause license. However, in July 2017 the project was migrated to a dual license of both Apache 2.0 and GPLv2 license. This change helped its adoption in Apache Software Foundation's projects after blacklist of the previous BSD+Patents license clause.

MinIO is a High-Performance Object Storage system released under GNU Affero General Public License v3.0. It is API compatible with the Amazon S3 cloud storage service. It is capable of working with unstructured data such as photos, videos, log files, backups, and container images with the maximum supported object size being 50TB.

<span class="mw-page-title-main">Windows Subsystem for Linux</span> Compatibility layer for running Linux binary executables natively on Windows

Windows Subsystem for Linux (WSL) is a feature of Windows that allows developers to run a Linux environment without the need for a separate virtual machine or dual booting. There are two versions of WSL: WSL 1 and WSL 2. WSL 1 was first released on August 2, 2016, and acts as a compatibility layer for running Linux binary executables by implementing Linux system calls on the Windows kernel. It is available on Windows 10, Windows 10 LTSB/LTSC, Windows 11, Windows Server 2016, Windows Server 2019 and Windows Server 2022.

Puma is an HTTP web server derived from Mongrel and written by Evan Phoenix. It stresses speed and efficient use of memory.

References

  1. "Rack HTTP server for Unix and fast clients".
  2. 1 2 Fulton, Hal; Arko, André (11 February 2015). The Ruby Way: Solutions and Techniques in Ruby Programming. Addison-Wesley Professional. p. 566. ISBN   978-0321714633.
  3. Bylina, H.N. (2014). Ruby Programming Language. Ruby on Rails framework (PDF). XX International conference for students and young scientists «MODERN TECHNIQUE AND TECHNOLOGIES». Tomsk: IOP Publishing.
  4. "Unicorn Power". 30 March 2010.
  5. "Why did you move to runit + Unicorn". February 2015.
  6. "Category: Web Servers". The Ruby Toolbox. Retrieved 2022-06-29.
  7. "Puma is Now the Recommended Ruby Webserver". 23 January 2015.
  8. Pavese, Tommaso (21 December 2016). "Unicorn vs Puma: Rails server benchmarks". Deliveroo.engineering.
  9. "How we migrated application servers from Unicorn to Puma". GitLab. Retrieved 2022-01-24.