9 ms·
Mongrel2 1.0 released.
- grrrrr 16y agoI have no doubt that for what it is this is a well designed piece of software, but, I'm gong to stick my neck out and say that purely for reasons of scalability a web server written in Ruby just doesn't seem like a sensible choice.
- nanexcool 16y agoI thought it was mainly C?
- basil 16y agoMongrel2 isn't written in Ruby. It's written in C: http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-110002 http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-110002
- grrrrr 16y agoIn which case I am remiss, although at time if writing it says here http://en.wikipedia.org/wiki/Mongrel_(web_server) http://en.wikipedia.org/wiki/Mongrel_(web_server) "Mongrel is an open-source HTTP library and web server written in Ruby by Zed Shaw.".
- ErrantX 16y agoMongrel 1.x is not related to Mongrel2. Mongrel was written by Zed in Ruby. Mongrel2 is a new project.
- dagw 16y agoMongrel and Mongrel2 are two very different projects that have very little beyond their name, author and the fact that they both are servers in common. They share no code and have very different designs and goals.
- yatsyk 16y agoI believe they share some code (http parser)
- thomasz 16y agowhich is written in Ragel and compiled to a C state machine, if I remember correctly
- masklinn 16y agoWell Ragel supports Ruby code output as well (it can generate any of C, C++, Objective-C, D, Java and Ruby). But I'd be surprised if Mongrel used that.
- zedshaw 16y agoSome people do that. It actually was used in jruby, and I think a couple projects generated the raw ruby rather than the C version. Uhm, I want to say Rubinius?
- masklinn 16y agoi don't doubt that, why would ragel generate Ruby code if nobody used it? I just doubt mongrel used ruby ragel-generated code.
- seanmcq 16y agoMongrel2 is a rewrite to be a scalable webserver that's language neutral. Think Apache (without all the pain). /this note is me sharing what I've learned from zed's tweets, I've not played with the software yet, please correct if wrong.
- chrismsnz 16y agoIs this a quote from someone else? Also, "does seem like a sensible choice"? Apart from that, it's completely written in C and uses language-agnostic ZeroMQ to pass "requests" back to the handler than can be written in any language with a ZeroMQ library (pretty much all of them).
- deleted 16y ago[deleted]
- ErrantX 16y agoTwitter used to use Mongrel, but replaced it with Unicorn (uh, another Ruby based server :)) http://engineering.twitter.com/2010/03/unicorn-power.html http://engineering.twitter.com/2010/03/unicorn-power.html
- nailer 16y agoWell they're using Scala in production now, so if they wanted to use Mongrel2 messaging, they probably can.
- steveklabnik 16y agoThey're using it for back end stuff, the front is still Ruby. To my understanding.
- kanwisher 16y agoUnicorn is based on the mongrel source
- risotto 16y agoI saw a demo of Mongrel2, and it's really slick. Lots of new concepts to get behind, which is both scary and exciting. There's no way I can use it for anything remotely close to production but I have some hobby ideas baking...
- zedshaw 16y agoThanks. Let me know what you do and shoot me bug reports on anything you find.
- slashclee 16y agoCongrats on the release, Zed!
- zedshaw 16y agoThanks man. Can't wait to get to the next level with it.
- jallmann 16y agoAccording to the Mongrel2 Book (http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-560005.1.1 http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-560005....), there is no pipelining of HTTP requests. Without testing anything for myself, I'm really surprised at this; are the perf gains from pipelining really as negligible as the book says they are?
- points 16y agoThat whole 'Note 8' sounds pretty stupid. "In Mongrel2 we use a parser that rejects invalid requests from first basic principles using technology that's 30 years old and backed by solid mathematics." The mind boggles... (Unless he's just being satirical here). Personally, my advice to anyone thinking of using mongrel2 would be to write your own webserver. You'll learn far more than you ever dreamt. If a webserver isn't that important to your success/failure, use a battle-worn webserver - apache etc
- lmz 16y agoWell, it is true. He's validating it with a grammar, not some adhoc parser implementation.
- points 16y agoCan you explain why 'validating it with grammar' is better than 'some adhoc parser'? IMHO a webserver is one of the things you want to be relaxed, laid back, and basically not care if the client gets things wrong. Just serve up what they look like they wanted.
- gvb 16y agoYeah, that is what Microsoft did (does). The result is most of the requests "look like" a desire to serve up viruses or spam. A grammar is theoretically provable (yes, that is a double entendre). An ad-hoc implementation is not provable and exhaustively testing its validity is unrealistic for anything but trivial grammars.
- arnorhs 16y agoSweet stuff. Arnor's got a new toy! Good job Zed.
- bnoordhuis 16y agoI've put up a GH repository of mongrel2 with its dependencies included. Compiling and installing should be as simple as typing: make all install PREFIX=$HOME/opt/mongrel2 http://github.com/bnoordhuis/mongrel2 http://github.com/bnoordhuis/mongrel2
- nailer 16y agoFirst, thanks! From your commit log: > Disable target install-py for now, it requires sudo. Agreed: re: disabling app that needs root unnecessarily. I don't want anything fucking with my OS python. Have you considered having it simply call pip instead, so it installs to the current virtualenv?
- bnoordhuis 16y agoI hadn't but I probably should have. Reading through the pip documentation as we speak - if you have some quick pointers, don't hesitate to post them.
- zedshaw 16y agoWe should revist this. It's mostly for convenience since lots of people just put the m2sh stuff wherever everything else goes. Problem is that screws up virtualenv folks. Any ideas on it other than disabling?
- baq 16y agoeverything else goes into virtualenvs or user bin/pythonpath; python stuff is unfortunately too fragile to put everything in one place.
- nailer 16y agoIt's not so much about Python being fragile, it's more that the OS - Linux in particular - uses Python itself, and modules can modify the behavior and break it. (same things if you used Puppet to manage your configs and broke your OS Ruby). Keeping everything in one dir also makes deployment way simpler.
- arturadib 16y agoI've read the introduction and I still don't quite know what the fuss is all about. Perhaps some examples of its benefits right in the introduction?
- steveklabnik 16y agoFirst of all, there's a fuss because it's written by zedshaw. Secondly, zedshaw also authored mongrel, a well-known web server that many people have taken the ragel-based parser from to build their own stuff. Third, everyone's been talking about this whole 'sqlite as configuration' thing, which could be awesome or horrible, the jury's still out. Finally, it's always interesting to see new projects in 'solved' areas. How long has Apache been around? How well is it tested? It obviously works, but could it be better? Zed's trying out new ideas, has a crazy amount of test coverage, and is starting out fresh. I haven't tried it yet. But it's certainly interesting.
- jshen 16y agowhat your'e saying is that there isn't yet a compelling reason for most people to try it.
- mikeryan 16y agoSounds like there are a ton of compelling reasons to try it.
- jshen 16y agoAs someone who runs multiple sites and who doesn't have a major problem with apache, what here should compel me to try it? Ragel parser? Um, why should I care if I'm not going to dig into the code myself? because zedshaw is so fucking awesome? Not a compelling reason to try a web server to me, is it to you? sqlite configuration? Maybe, but that's not super compelling to me at the moment. despite my sarcasm, my question is sincere. I'm curious how mongrel2 could be an improvement over what is currently used, which for me is mostly apache Any other reasons?
- emehrkay 16y agoI am simply impressed at how much sh*t he gets done. I honestly want to be more like him
- jshen 16y agoyou should probably spend less time here ;)
- SkyMarshal 16y agoI actually think it's fine to spend time on HN, you just can't also spend tons of time on tons of other sites as well. Based on anecdotal evidence only, it seems the rate at which articles move up and down the HN frontpage pretty much ensures you'll see everything that hits the front page per day if you check HN twice - once in the morning and once in the late afternoon or evening. I don't think that's too much HN browsing to prevent you from being uber productive, as long as you're not also browsing tons of other sites on the net too.
- jshen 16y agoor having discussions in the comments
- ubercore 16y agoI'm missing the boat on how it's more language agnostic than other web servers (I'm most familiar with Apache)? EDIT: I see now that it's "language agnostic" based on using ZeroMQ to shuttle request/responses between Mongrel2 and a language with a ZeroMQ library. Sounds cool, but also makes me wonder exactly how that's different from someone writing, say, mod_zeromq for Apache, and attaching handlers to ZeroMQ in the same way Mongrel2 does? Am I missing something?
- alexgartrell 16y agoMongrel2 specializes. This means way less cruft. It should also be much more performant in this role than Apache [citation needed], because Apache has sooooo much other stuff.
- zedshaw 16y agoApache's architecture is such that it's very bound to "files" and a strict request/response message pattern. That makes things like long polling, async sockets, and even streaming say ICY (check our mp3stream demo) really difficult. In Mongrel2 it's kind of like every thing's long poll or an async socket. That let's you do a ton of very cool things you can't do easily in Apache or other web servers. Sure you could hack them in, but it's a nightmare.
- ubercore 16y agoI think I get it, thanks. Mongrel2 is better at being language agnostic, by virtue of intentional design. Looking forward to trying it out!
- michaelhalligan 16y agoGood work Zed!
- oomkiller 16y agoSo is this designed to replace apache/nginx, or should i throw it behind an nginx upstream still and let nginx serve the files?
- there 16y agoit can do either, but i think it's designed to do the former.
- limist 16y agoIf you're not immediately grokking the significance of Mongrel2 (as I did not), be sure to check out the documentation's Introduction: http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-40001 http://mongrel2.org/doc/tip/docs/manual/book.wiki#x1-40001 The features sound cool and significantly evolved past current webservers. And the documentation is extensive and so far, an enjoyable read - now that's impressive. :)
- againstyou 16y agoany benchmark against mongrel1 ?
- agazso 16y agoI have an old idea regarding webservers: peer-to-peer file transfer. The server would not store the file on disk, only the last transferred block in memory. Rate control would be done at TCP level: while the block is not transferred by the receiver, the server would not read again from the sender. I have written several HTTP servers myself, and I know it's doable, but the world does not need another webserver that only has this distinguishing feature. My question is if all of this can be done with Mongrel2?
- deweller 16y agoI believe the potential of Mongrel2 lies in real-time web applications. Want to write a backend in PHP for a real-time chat? That is very difficult with Apache and mod_php. With Mongrel2 and ZeroMQ, it is almost trivial. Mongrel2's asynchronous pub/sub networking paradigm opens up possibilities for real-time communication to browsers. When websockets get real, Mongrel2 may very well be the way we all start using them. Where Mongrel2 has some ground to cover is handling traditional server-generated pages. Want to run an existing PHP application with a framework like CodeIgniter? You can't do it from Mongrel2 without proxying to nginx or apache (yet). Hopefully this is something that will come along in Mongrel2 v2.0.