Application Servers

unicorn – HTTP server for Rack applications

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.

This is free and open source software.

Key Features

  • Designed for Rack, Unix, fast clients, and ease-of-debugging.
  • Compatible with Ruby 2.0.0 and later.
  • Process management: unicorn will reap and restart workers that die from broken apps. There is no need to manage multiple processes or ports yourself. unicorn can spawn and manage any number of worker processes you choose to scale to your backend.
  • Load balancing is done entirely by the operating system kernel.
  • Requests never pile up behind a busy worker process.
  • Does not care if your application is thread-safe or not, workers all run within their own isolated address space and only serve one client at a time for maximum robustness.
  • Builtin reopening of all log files in your application via USR1 signal. This allows logrotate to rotate files atomically and quickly via rename instead of the racy and slow copytruncate method. unicorn also takes steps to ensure multi-line log entries from one request all stay within the same file.
  • nginx-style binary upgrades without losing connections. You can upgrade unicorn, your entire application, libraries and even your Ruby interpreter without dropping clients.
  • transparent upgrades using systemd socket activation is supported.
  • before_fork and after_fork hooks in case your application has special needs when dealing with forked processes. These should not be needed when the “preload_app” directive is false (the default).
  • Can be used with copy-on-write-friendly GC in Ruby 2.0+ to save memory (by setting “preload_app” to true).
  • Supports listening on multiple interfaces including UNIX sockets, each worker process can also bind to a private port via the after_fork hook for easy debugging.
  • Simple and easy Ruby DSL for configuration.
  • Decodes chunked requests on-the-fly.

Website: yhbt.net/unicorn
Support: Source Code Repository
Developer: The Unicorn Community
License: GPLv2 or later (GPLv3+ preferred), or Ruby (1.8)-specific terms

unicorn is written in Ruby. Learn Ruby with our recommended free books and free tutorials.


Related Software

Ruby Application Servers
PumaConcurrent web server for Ruby and Rack
Phusion PassengerWeb server and application server for Ruby, Python and Node.js
unicornHTTP server for Rack applications
Rainbows!HTTP server for sleepy Rack applications based on Unicorn
yahnsSleepy, multi-threaded, non-blocking application server for Ruby

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments