Section 2.3. What Can Mongrel Do for Me?

2.3. What Can Mongrel Do for Me?

This section describes what you can expect from Mongrel, whether you are a developer, sysadmin or manager.

2.3.1. For the Developer

Mongrel is great for local development.

If you are doing Ruby development, then using Mongrel is a no-brainer. It's much faster than WEBrick and can handle heavy development work (with all the logging and reloading turned on) easily. It installs with one command and configures with another. You can be up and running in less than a minute.

It integrates nicely with Rails (and other Ruby frameworks).

Mongrel was initially created to simplify developing and running Rails applications, so most Mongrel users are Rails developers. They have contributed some excellent plugins to handle common tasks like clustering, file uploads, and DRb process handling, and they are a great place to learn how to write your own. In June 2006 the Rails Core team integrated Mongrel with script/server, so if that is your comfort zone, you only need to have Mongrel installed.

Extend your application easily.

Mongrel has been designed to make extending it (or your Web application) easy. You can think of Mongrel as a tight Ruby library that deals with the sticky mechanics of HTTP, gives you simple access to the request, and otherwise stays out of your way. The interfaces for extending it are clean and easy to understand, so even if you shy away from Ruby outside of Rails-world, you should take a look. Frequently you can speed up your application by offloading certain tasks and having Mongrel handle them instead. If you have your own Ruby library that is not one of the supported frameworks (see Section 3.4), you can write a handler so Mongrel can load it with all the special options you need. See Section 6 for details.

Mongrel includes excellent debugging tools.

Mongrel includes thorough tools to help you debug your application. You can watch the entire request and response process too, and write your own handlers and plugins to dig as deeply as you need to test your application and environment.

Mongrel is the same in production.

As you build, test, and deploy your application, you can rest assured that Mongrel will work exactly the same when in the production environment. This comes in handy when you need to run your tests, integrate with other systems and services, work with caching, etc. See Section 4 to see how Mongrel is used on both local development boxes and production environments.

2.3.2. For the System/Network Administrator

If you are wondering how Mongrel would fit into your system architecture, you shouldn't feel alarmed. Zed was a sysadmin for years, and spent so much time dealing with poorly designed packages that he knew what it would take to make Mongrel play nice with common server configurations.

Mongrel is a real Web server.

Mongrel is a fully HTTP-compliant server (more compliant that most), and can speak HTTP directly with all the network devices that common hardware and software configurations use. This saves you from the need to translate requests into CGI or use buggy or slow modules (like mod_ruby or FastCGI) to connect to your Ruby application.

Mongrel is a Ruby application.

Since Mongrel is written in Ruby, it can load and run any Ruby code natively, just like Tomcat does with Java Applications (except it doesn't need a 120MB footprint!). This is why you won't need something like FCGI, SCGI Rails Runner, or modules anymore to pass the HTTP Request to the Application Framework.

Mongrel can be clustered and deployed easily.

Mongrel has been designed to be Dead Simple to set up in production environments. This means that major concerns such as clustering and deployment have been addressed and best practices are already in place. See Section 4.2 to learn more about mongrel_cluster and Section 5 to see how folks are setting it up with Capistrano.

2.3.3. For the Manager

Discriminating minds choose Mongrel.

Mongrel has been widely seen as the clear choice among the available options for developing and running a Rails application. The same could be said for developing and running any Ruby application, but so far the biggest group of Ruby developers are using Rails to build their sites and Mongrel to run them. Mongrel is not a whole lot of code, and it hasn't even been around for a year. Yet for some reason, within just six months it became the preferred way to develop and serve production Web applications.

Mongrel is pretty damned secure.

Claiming that one's software is "secure" is usually asking for it, so we'll say that Mongrel is "pretty damned secure." Zed explains why in Zed Sez in Section 9.

Mongrel's license is capitalist-friendly.

Mongrel and its sub-project GemPlugin use the Ruby license, which you can read here at Some folks are scared of using open source software because they think it will force them to open-source their code (which is actually true in certain cases with GPL and LGPL, for example). Ruby's license is less restrictive, and was good enough for Apple to include Mongrel in the next version of OSX.

Mongrel. Serving, Deploying, and Extending Your Ruby Applications
Mongrel. Serving, Deploying, and Extending Your Ruby Applications
ISBN: 9812836357
Year: 2006
Pages: 48 © 2008-2017.
If you may any questions please contact us: