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 | |
|---|---|
| Puma | Concurrent web server for Ruby and Rack |
| Phusion Passenger | Web server and application server for Ruby, Python and Node.js |
| Falcon | Asynchronous Rack-compatible engine for fast, scalable web traffic |
| pitchfork | Preforking HTTP engine designed for resilience and steady throughput |
| iodine | Lightweight HTTP and WebSocket service built for demanding loads |
| unicorn | HTTP server for Rack applications |
| Itsi | High-performance web serving with efficient request handling |
| Rainbows! | HTTP server for sleepy Rack applications based on Unicorn |
| Agoo | Fast HTTP platform with WebSocket support and very low overhead |
| yahns | Sleepy, multi-threaded, non-blocking application server for Ruby |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.