Why use Mongrel2?

I am confused what purpose Mongrel2 serves / provides nginx doesn't yet.

(Yes, I read manual , but I have to be too big to understand how this is fundamentally different from nginx)

My current web application stack:
- nginx : web server
- Lua : programming language
- FastCGI + LuaJIT : for connecting nginx to Lua
- Postgres : database

+73
lua webserver nginx mongrel2
May 22 '11 at 16:00
source share
2 answers

If you could only name one, then it would be that Mongrel2 would be built around ZeroMQ , which means that scaling your web server has never been so easy.

If the request arrives, Mongrel2 receives it (nothing unusual here, like for NginX and any other httpd). The next thing that happens is that Mongrel2 distributes the task of compiling the response to n (ZeroMQ-enabled) backends, waiting for them to complete the work, get the results, compile the response and send it to the client.

Now the magic is that n can be any number and that each of n can be written in any language supported by ZeroMQ (about 20 or so), plus everything goes on the network, so that every n can be a dedicated block, maybe , in another data center.

In other words: with NginX and everything else you need to do scalability at your logical level, Mongrel2 allows you to start (from the point of view of the request / response cycle) this right, where the request gets into your infrastructure, on httpd instead of allowing complexity to go down to your logic level, which resets complexity up by at least one order of magnitude imo.

+116
May 26 '11 at 9:21 a.m.
source share

You should look at each one's strengths and decide to use one or both depending on your use cases.

So far, it seems that nginx is doing everything mongrel2 provides on the surface, you will find that there are big differences in focus between them.

Nginx shines as a front-end web server that can request proxies for your web servers / application servers, as well as serve static content.

Mongrel2 is a small change in the stack. As already mentioned, this comes from using zeromq as the transport layer between it and the backend application servers. It can serve dynamic request requests (application requests) and send the computational part of the task to different servers using zeromq .. mongrel2 allows you to serve not only http, websockets, etc., but also other protocols (if you are inclined to do this) from of the same server. the user will never know that parts of the application are served from different backends.

If your requirements for the functionality of your webapp continue to change or you want to add things like streaming, the ability to encode in different languages ​​at the end, etc., then I will definitely look at mongrel2. Or even have a hybrid where you use nginx / haproxy / lnish for static files and caching, and everything else is directed to mongrel2.

+13
Jan 04 '12 at 18:32
source share



All Articles