views:

2493

answers:

4
+10  Q: 

Mongrel vs. WEBrick

What is the difference between Mongrel and WEBrick?

Which one should I use?

Why does Rails ship with both?

+7  A: 

Mongrel is considerably more efficient and stable.

Eli
+15  A: 

For your local development, they'll both work. Mongrel is faster, more efficient, and stable. Some people (myself included) use it to host their production sites, even. Certainly okay for local development.

If you're on non-Windows, I'd suggest looking at Phusion Passenger. You can support multiple apps on your localhost without having to do a 'ruby script/server' every time you want to run something.

When running Phusion Passenger, you'll have to tail the log file yourself. mongrel will display the log in the console window, so to get that functionality you'll have to tail -f log/development.log with Passenger.

Why does Rails ship with both? History. Webrick is written in ruby, so it was the early favorite. Mongrel came along and was better, but webrick support wasn't dropped.

If you don't want to install Phusion Passenger, use mongrel. It's the default and it works.

EDIT 2009-08: I've also had good luck with thin, a drop-in replacement for mongrel. For development, it's not that big of a deal, but it'd be something to check out for production.

wesgarrison
incorporate the other two comments and i'll accept this answer.
landon9720
+1  A: 

I also like how mongrel outputs useful information to stdout while it's running. Both will do, mongrel is better then webrick for production. Phusion is also really cool but I don't use it for dev.

nkassis
+1  A: 

While both would do, I heavily recommend against using WEBrick, it is really flakey even in development mode, and will sometimes even require a restart when it shouldn't.

I definately recommend Mongrel for development as it means you don't have to set up Apache the way you might want or need it to develop, you get an idea of how your app will probably function even in production, and really I don't see how typing script/server is that awful.

railsninja