This can
give a huge performance improvement, because evaluating Ruby in the call chain always has
some impact on performance.
Mongrel
A few years back, a hacker named Zed Shaw decided that WEBrick wasn??™t a good enough web
server for Ruby. He spent some time trying to come up with a better solution, and the result
was Mongrel: a good web server written mostly in Ruby with a small C extension for handling
the parsing of requests. Mongrel 1.0 was released in conjunction with Rails 1.2 in the beginning
of 2007. Mongrel is widely believed to be much faster than WEBrick, and is also a good
standalone library for creating smaller web applications. In many places, Mongrel has
replaced WEBrick as the server of choice for Rails development. Because it is fast to start and
easy to configure in standalone mode, this means you get a better and faster web server for
your Rails development, all for free.
For smaller web applications, you can also use Mongrel in standalone mode to serve Rails
applications in production. If you know that the site traffic will be small, and there is no huge
demand on scalability, Mongrel is usually good enough. It??™s also easy to get going; you can just
start it with script/server and it runs flawlessly.
Pack of Mongrels
To solve the scalability problem with Mongrel, the standard solution is to deploy a ???pack of
Mongrels.??? This is made easy by a small plug-in for Mongrel called mongrel_cluster that lets
you start several Mongrel instances on the same machine with consecutive port numbers.
Pages:
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303