Mongrel is an
open-source software
Open-source software (OSS) is Software, computer software that is released under a Open-source license, license in which the copyright holder grants users the rights to use, study, change, and Software distribution, distribute the software an ...
HTTP
HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
library
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
and
web server
A web server is computer software and underlying Computer hardware, hardware that accepts requests via Hypertext Transfer Protocol, HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, co ...
written in
Ruby
Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...
by
Zed Shaw
Zed A. Shaw is a software developer best known for creating the ''Learn Code the Hard Way'' series of programming tutorials, as well as for creating the Mongrel web server for Ruby web applications. He is also well known for his controversial vi ...
. It is used to run Ruby
web application
A web application (or web app) is application software that is created with web technologies and runs via a web browser. Web applications emerged during the late 1990s and allowed for the server to dynamically build a response to the request, ...
s and presents a standard HTTP interface. This makes layering other servers in front of it possible using a
web proxy, a
load balancer
In computing, load balancing is the process of distributing a set of tasks over a set of resources
''Resource'' refers to all the materials available in our environment which are Technology, technologically accessible, Economics, economically ...
, or a
combination of both, instead of having to use more conventional methods employed to run
scripts such as
FastCGI
FastCGI is a binary protocol for interfacing interactive programs with a web server. It is a variation on the earlier Common Gateway Interface (CGI). FastCGI's main aim is to reduce the overhead related to interfacing between web server and CGI pr ...
or
SCGI to communicate. This is made possible by integrating a custom high-performance HTTP request
parser
Parsing, syntax analysis, or syntactic analysis is a process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar by breaking it into parts. The term '' ...
implemented using
Ragel
Ragel ( IPA: ) is a finite-state machine compiler and a parser generator. Initially Ragel supported output for C, C++ and Assembly source code, later expanded to support several other languages including Objective-C, D, Go, Ruby, and Java. Ad ...
.
Mongrel was the first web server used by
Twitter
Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
, and inspired
Node.js according to Ryan Dahl.
Shaw subsequently created
Mongrel2, an open-source "
language agnostic" web server and the successor to Mongrel server.
Deployment
One popular configuration was to run
Apache HTTP Server
The Apache HTTP Server ( ) is a free and open-source software, free and open-source cross-platform web server, released under the terms of Apache License, Apache License 2.0. It is developed and maintained by a community of developers under the ...
2.2 as a
load balancer
In computing, load balancing is the process of distributing a set of tasks over a set of resources
''Resource'' refers to all the materials available in our environment which are Technology, technologically accessible, Economics, economically ...
using
mod_proxy_balancer in conjunction with several Mongrel instances. Each Mongrel instance would run on a separate
TCP port, configured via the mongrel_cluster management utility. Until 2010,
Twitter
Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
was a notable instance of this configuration; they then switched to
Unicorn
The unicorn is a legendary creature that has been described since Classical antiquity, antiquity as a beast with a single large, pointed, spiraling horn (anatomy), horn projecting from its forehead.
In European literature and art, the unico ...
.
Mongrel was capable of serving
Ruby on Rails
Ruby on Rails (simplified as 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 pa ...
powered sites without requiring any other web servers, though as a
single-threaded
In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. In many cases, a thread is a component of a proc ...
application this configuration is unsuitable for all but light loads.
Deprecation
After the original author
Zed Shaw
Zed A. Shaw is a software developer best known for creating the ''Learn Code the Hard Way'' series of programming tutorials, as well as for creating the Mongrel web server for Ruby web applications. He is also well known for his controversial vi ...
left the
Ruby on Rails
Ruby on Rails (simplified as 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 pa ...
-scene the releases of Mongrel stopped. The current release 1.1.5 is no longer able to install in Ruby versions higher than 1.9.2 which is recommended for Rails 3, the fix is to use the much older 1.2.0-pre2 release of Mongrel which isn't stable.
A new and maintained server, called Thin,
uses the Mongrel parser. The Mongrel parser has also been forked by
Unicorn
The unicorn is a legendary creature that has been described since Classical antiquity, antiquity as a beast with a single large, pointed, spiraling horn (anatomy), horn projecting from its forehead.
In European literature and art, the unico ...
and by
Puma.
References
External links
Official website
{{DEFAULTSORT:Mongrel (Web Server)
Free web server software
Ruby (programming language)
Web server software for Linux