Cool visualization of merb's framework load process

Posted by ezmobius Thu, 08 May 2008 04:51:00 GMT

Michael Klishin made a sweet mapping of a merb server’s boot process. Hopefully we can get stuff like this made for other parts of the framework as well as I think it can really help you find your way around the source code of merb-core.

5 comments

Merb-0.9.3 released

Posted by ezmobius Mon, 05 May 2008 02:36:00 GMT

Merb 0.9.3 is mostly (but not only) a bugfix release. We’ve not only added several features very useful for developers who want to use Merb for web services, but fixed many bugs, greatly improved spec coverage and quality, made documentation better, and did some performance-related work.

diffstat shows 95 files changed, 3359 insertions(+), 837 deletions(-)

Read more...

9 comments

Engine Yard needs Erlang Programmers

Posted by ezmobius Thu, 01 May 2008 23:26:00 GMT

Engine Yard is looking for one or two kick ass Erlang programmers to help work on our next generation cloud computing platform. Knowledge of ruby/xmpp/ejabberd/linux is a plus.

If you think you fit the bill then please email me directly at ezra@engineyard.com.

Tags  | 4 comments

Hey Rails, nice Rack!

Posted by ezmobius Fri, 25 Apr 2008 00:34:00 GMT

So i’ve spent this week hacking on Rails, specifically going spelunking in ActionPack and porting Merb’s rack machinery to rails. I figure that merb is a very nice experimentation ground and decided it was time to give some love back to the framework that inspired merb.

While still not complete, I have made significant headway on racking up rails in my github fork of Rails. I’ve added rack adapters for mongrel, eventedmongrel, thin, ebb and webrick. All of this is controlled via ./script/rackup in a rails app. So to start a cluster of 5 thin servers you would run this command:

./script/rackup -a thin -c 5 -e production

I do have to say that parts of ActionPack haven’t been touched in a long time and had accumulated some cruft, with the rails rack adapter that thin and ebb use there was a dogpile of wrappers going on. A web request was wrapped in many layers like this(the → means ‘wrapped in’)

raw request -> rack env -> Rack::Request -> CGIWrapper -> CgiRequest

That was far too many wrappers, it also turned out that some of these wrapper were making duplicates of all the CGI headers, meaning quit a bit of wasted memory on every request. I’ve slimmed it down to this now:

raw request -> rack env -> ActionController::RackRequest

With no more duplication of CGI headers, win!

I’ve also changed the giant mutex lock to be much smaller, it used to lock around the dispatcher callbacks, route recognition, controller instantiation, filters and action dispatch. Now it only locks around filters and action dispatch, Dispatcher callbacks, route recognition and controller instantiation all happen outside of the lock. This makes for a nice little speed boost with standard mongrel under concurrent load.

Of course this doesn’t work so hot in development mode when you have concurrent requests, it falls apart due to route set reloading and class reloading done in dev mode. But if you are just using your browser to test the app in dev mode you won;t ever notice since you won;t be making concurrent requests. In production mode the route recognition appears to be thread safe, more extensive testing and stressing will be needed to be 100% certain though.

All in all I feel like these are some big wins for Rails. And I’m not done yet, I plan on beating up ActionPack quite a bit more until it submits ;)

Tags  | 40 comments

Deferred requests with merb, ebb and thin

Posted by ezmobius Fri, 18 Apr 2008 06:20:00 GMT

There is a classic tradeoff between threaded servers and event driven servers. Event driven servers tend to be much faster than threaded servers when all the requests are fairly fast. But the event model falls down if you have long requests like file uploads or reporting actions. This is because the long action blocks the event loop, effectively keeping other requests from running.

There are two new event driven ruby webservers at your disposal these days, Thin and Ebb. Both of these servers support the Rack web server interface that merb uses. Until now both of these servers were not the best choice for file uploads or long blocking actions but that’s all changing.

Both ebb and thin have added a deferred?(env) method to their rack adapter interface. Both webservers will call this method on your Rack @app object before they call your call(env) method. This allows your rack adapter to determine if the request should be run in its own thread if it’s slow.

I’ve just committed support for this deferred_actions construct in merb-core. If you want to run on thin or ebb but you have say a file upload action and some slow reporting actions you could add this to your init.rb in your app:

Merb::Config[:deferred_actions] = ["/uploads/create", "/reports/longaction"]

What this means is that all of your actions will run in fast event driven mode except for requests to /uploads/create and /reports/longaction. Any request for either of these urls will be served from a newly spawned thread, all other requests will be served by the main event loop.

This allows us to have the best of both world. Combining threaded and event driven styles to use the strengths of both makes a lot of sense here.

Cheers to the authors of ebb and thin for making the same interface. All of this requires the HEAD versions of ebb or thin so if you want to play along at home you will need to build thin or ebb from source on github: ebb and thin

Tags , ,  | 18 comments

wiki.merbivore.com lives!

Posted by ezmobius Fri, 11 Apr 2008 06:59:19 GMT

Jed Hurt and Lance Carlson made a nice wiki engine in merb that we’ve thrown up at http://wiki.merbivore.com. Thanks Guys!

You can get the source to the wiki app on github: Collective Wiki Engine

There are the starts of some good information published already, please feel free to add to it!

1 comment

Fork You!

Posted by ezmobius Thu, 10 Apr 2008 19:46:00 GMT

GitHub has officially launched! No more invites required to sign up.

In preparation for their launch we set them up on a shiny new Engine Yard cluster. With all the adoption of git/github as well as Rails itself about to switch to github we wanted to make sure everyones favorite git repo hosting can scale as far as folks want to take it.

So go Sign Up already and fork your favorite projects to your hearts desire!

Tags  | no comments

Videos of my Merb keynote posted by Confreaks

Posted by ezmobius Sat, 29 Mar 2008 21:38:33 GMT

Confreaks has done a great job of recording Mountain West Rubyconf and getting the video online quickly. You can go see my talk here:

Strengthening the Ruby Ecosystem: Merb

9 comments

Mountain West Rubyconf Merb Slides

Posted by ezmobius Sat, 29 Mar 2008 00:09:00 GMT

Here are my slides from my keynote at Mountain West Rubyconf this morning:

http://www.slideshare.net/ezmobius/merb-core/

Tags  | 2 comments

Merb-0.9.1 Developer release

Posted by ezmobius Wed, 05 Mar 2008 06:17:00 GMT

We’ve released the 0.9.1 version of merb to the merbivore.com gem server. This release has a lot of polish and is getting very close to being stable api wise after the big 0.5.3 → 0.9.x refactoring.

You can see the big changelog here.

I’m pretty happy with how the codebase is shaping up, this was a major refactoring of merb and we’ve come out with a very clean system. Performance is improved quite a bit from older 0.5 versions of merb.

We’ve split the code base into multiple parts, merb-core, merb-more and merb-plugins. merb-core is the heart of the system, it has the rack abstraction along with the dispatcher, router, controller and view layers. You can make very fast, small footprint services and apps with just merb-core.

merb-more has a bunch of add-ons for core. More consists of:
merb-action-args
merb-assets
merb-builder
merb-gen
merb-haml
merb-mailer
merb-parts
merb-test

And merb-plugins consists of:

merb_activerecord
merb_datamapper
merb_helpers
merb_param_protection
merb_sequel
merb_stories
merb_test_unit

Wow that’s a lot of gems! Merb is built in a modular way that allows you to cherry pick features so you never have to load code you aren’t going to use. This helps keep the memory footprint down when building service style apps. But still allows for all the advanced features you want.

You see, Merb is built on rubygems and Merb plugins are just rubygems so plugins have the same standing as built-ins code loading wise. Merb is just begging you to peek under the hood to see how it ticks ;)

To make things easier to get started we still have a merb gem that will install all of merb-core and merb-more for you. You should uninstall all of your old merb gems before you install the new version.

$ sudo gem install merb -y --source http://merbivore.com

Merb development has moved to GitHub for source control and Lighthouse for ticketing.

The best place to get merb questions answered is still #merb on irc.freenode.net. We will have a wiki and a google group up shortly.

Let us know what you think, kick the tires and all that. After it settles for a few days we will push it to rubyforge, hopefully by this weekend.

6 comments

Older posts: 1 2 3 4 5 ... 15