首页 > 有谁了解mongrel2这个东西?

有谁了解mongrel2这个东西?

今天看了下mongrel2这个东西,感觉蛮强大的,支持很多语言绑定,集成zeromq~


我觉得这个架构很赞,我也正在采用。


好象现在已经是正式版了吧~


有可能成为下一个性能卓越的web服务器,特别是在路径匹配上面的性能,期待正式版的发布
更多可以看mongrel2的作者的博客http://sheddingbikes.com/posts/127714...


今天才发现Mongrel2,花时间看了一下它的代码。Mongrel2非常奇特的地方在于:
What makes Mongrel2 special is how it satisfies these requests in a language agnostic and asynchronous way using a simple messaging protocol to talk to applications; not just serve files. Mongrel2 is also designed to be incredibly easy to automatically manage it as part of your infrastructure.
Other web servers do some of these things, but they either do them in a bastardized way or not all of them at once. Plenty of language specific web servers like Node.js and Jetty have asynchronous operation, but they’re not language agnostic1 . Other web servers will let you talk to any language as a backend, but they insist on using HTTP proxying or FastCGI, which is not friendly to asynchronous operations.

基本架构是:
a、非阻塞IO
b、通过libtask实现event IO和每Connection一个coroutine
c、和Mongrel一样用Ragel实现HTTP协议解析
d、将Request编码为JSON或TNetString发送到ZeroMQ
e、ZeroMQ的客户端作为Handler接收Request进行处理
f、Handler将响应写回ZeroMQ
g、Mongrel2将Response写回给Http Connection
h、这整个过程又是通过Ragel管理状态机来实现的

【热门文章】
【热门文章】