Posted by ezmobius
Thu, 31 May 2007 08:02:00 GMT
Just a quick post here to link to a sweet merb tutorial with a nice restfull sample app by Zack Chandler
Here’s the tutorial. And here is the repo with a RESTful invoice tracker merb app
Also I just released the merb0.3.3 gem. Thanks to Dave Goodlad we now have route generation helpers as well, check it out:
$ merb -i
merb init called
irb(main):001:0> show_routes
[:edit_comment, "/posts/:post_id/comments/:id/edit"]
[:new_post, "/posts/new"]
[:posts, "/posts"]
[:custom_new_post, "/posts/new/:action"]
[:edit_post, "/posts/:id/edit"]
[:comment, "/posts/:post_id/comments/:id"]
[:post, "/posts/:id"]
[:new_comment, "/posts/:post_id/comments/new"]
[:custom_new_comment, "/posts/:post_id/comments/new/:action"]
[:comments, "/posts/:post_id/comments"]
=> nil
irb(main):002:0> url :edit_comment, :post_id => 42, :id => 24
=> "/posts/42/comments/24/edit"
irb(main):003:0> url :posts
=> "/posts"
irb(main):004:0> url :posts, :format => 'xml'
=> "/posts.xml"
irb(main):005:0> url :posts, :format => 'xml'
=> "/posts.xml"
irb(main):006:0> url :edit_comment, :post_id => 42, :id => 24, :format => 'js'
=> "/posts/42/comments/24/edit.js"
There is one slight change in the router.rb route definition that you have to change if you are upgrading from an older merb. In dist/conf/router.rb, you need to use Merb::Router.prepare instead of Merb::RouteMatcher.prepare.
There are a lot of new little features in this release from the hackfest at Railsconf. Keep them patches coming folks
Tags merb | 4 comments
Posted by ezmobius
Thu, 24 May 2007 03:40:00 GMT
I’m really stoked about this. I think rubinius has so much potential that I am really happy to be able to support it. Starting next month Evan Phoenix is going to be working here at EY half time on ey tools and such and half time on rubinius.
For those of your who aren’t familiar with rubinius you can read a bit more about it here. It’s a new implementation of ruby done in a smalltalk style with a small core VM written in C and almost everyting else written in ruby. Really, even String and Array and definied in ruby. Rubinius is going to open up core ruby hacking to the masses as the internals won’t be a bunch of gnarly C code thats really hard to grasp.
There is still a lot of work to get rubinius to 1.0 status but hopefully hiring Evan will help speed the process. I think we have a great platform to abuse rubinius on here at EY to help it become production worthy.
I love my job folks. I get to play on phat hardware and get to hire some of the smartest hackers around. This is great!
Rubinius FTW!
Tags ey, rubinius, ruby | 15 comments
Posted by ezmobius
Sun, 20 May 2007 00:53:16 GMT
Here are my slides from the talk I gave today at Railsconf2007.
Xen and the Art of Rails Deployment
15 comments
Posted by ezmobius
Fri, 18 May 2007 21:16:00 GMT
Ok so I’m not the best organizer for the merb hackfest. So I didn’t think ahead to actually aquiring a space to hold it. So I’m going to be hacking merb at the Jupiter Hotel tonight at 6:30pm. The address is 800 E. Burnside St.
From the conference you can just walk down Martin Luther King Blvd and take a left turn on Burnside and go up a few blocks.
Hope to see you there!
Tags hack, merb | 1 comment
Posted by ezmobius
Mon, 14 May 2007 18:52:00 GMT
We have been building a massive amont of hardware at Engine Yard over the last week. Last night Tom and I assembled this little bad boy to bring to RailsConf with us:

Come by our booth when you’re at the conference and check out what we’ve been up to.
Tags servers | 6 comments
Posted by ezmobius
Sat, 12 May 2007 08:49:00 GMT
Kirk Haines of the IOWA project has finally released his swiftiply package. I’m really excited about this project. The project has a few parts. There is a monkey patch to Mongrel that rips out ruby’s threading and Socket classes and replaces them with an eventmachine event loop. I have been testing this evented mongrel extensively for the past few weeks and it is notably faster and higher throughput then normal multi threaded mongrel.
It’s a drop in compatible with rails and merb and should work with any custom mongrel handlers you have. Once you install the swiftiply package you can start mongrel_rails with the new evented mongrel like this:
$ EVENT=1 mongrel_rails start
I am getting a huge speedup in merb from evented mongrel. And rails apps run very stable and do not start to slow down and bloat under high concurrent load like threaded mongrel does.
This is big news people. This thing makes shit faster and more stable under load
Now that it the easy way to get started with evented mongrel and buy yourself some performance. But the swiftiply proxy is also very very cool.
Swiftiply works differently from a traditional proxy. In Swiftiply, the
backend processes are clients of the Swiftiply server—they make persistent
socket connections to Swiftiply. One of the major advantages to this
architecture is that it allows one to start or stop backend processes at will,
with no configuration of the proxy. The obvious disadvantage is that this is
not behavior that backends typically expect.
Luckily there is a swiftiplied version of mongrel in this package as well. I’ll make another post about how to use swiftiply later.
A week or so ago I was able to speed merb up from 299req/sec fro hello world to 620req/sec. Well dropping in evented mongrel gets merb’s hello world to a blazing 987req/sec!! no bull, see this pastie:
http://pastie.caboo.se/57881
So go grab swiftiply and play around a bit. I am using this in production for more then a week now with no adverse affects and the app that runs it has much better response times and memory usage then it did before.
http://swiftiply.swiftcore.org/index.html
Tags event, merb, mongrel | 31 comments
Posted by ezmobius
Thu, 10 May 2007 22:32:56 GMT
I am going to put together a merb hacknight druing railsconf next week. Anyone who wants to be involved leave a comment so I can see how much space we will need or not need.
Thanks
26 comments
Posted by ezmobius
Sun, 29 Apr 2007 04:03:00 GMT
Merb 0.3 is out in gem form peoples. I stayed up late last night hacking on merb trying to find a really annoying memory leak. In the process I refactored the class loading to be a noop in produciton mode and made frozen constants for most string’s merb uses over and over internally.
Before I was able to find the mem leak I had improved the performance of a merb hello world app from 298req/sec on my maccbook to a whopping 688req/sec on one process. Peep the numbers
Finished 15000 requests
Server Software:
Server Hostname: localhost
Server Port: 4000
Document Path: /hello
Document Length: 11 bytes
Concurrency Level: 1
Time taken for tests: 21.784 seconds
Complete requests: 15000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 1965000 bytes
HTML transferred: 165000 bytes
Requests per second: 688.58 [#/sec] (mean)
Time per request: 1.45 [ms] (mean)
Time per request: 1.45 [ms] (mean, across all concurrent requests)
Transfer rate: 90.20 [Kbytes/sec] received
Yup that’s 1.4ms average response time for a simple action that returns a “hello world!” string.. Of course full actions with templates and such are not as fast as this but this is the theoretical fastest request merb can serve that goes thru the full routing and dispatcher. This gives you a lot more headroom for your application code then rails does.
Anyway I finally tracked down the memory leak to an implementation of traits that I added recently. This bascially had the effect of retaining a reference to every controller ever instantiated. Ouch! I refactored away from traits and back to class_inheritable_attributes and killed the mem leaks so merb used a flatline 21Mb of ram even after 50k requests in a row.
Mrblog is being worked on again and I hope to have merb’s own site launched in time for railsconf.
Tags fast, merb, mongrel | 6 comments
Posted by ezmobius
Mon, 23 Apr 2007 15:35:00 GMT
Here are the slides form my talk on Custom Mongrel Hanlders and Merb at the SDForum Rubyconf this past weekend. There was video shot that I hope will be posted soon. The slides don’t show the entire story as I did a bunch of live benchmarks and some hacking and code exploring, but you can get the idea.
Mongrel: Learning how to walk the dog
Tags handlers, merb, mongrel, server | 5 comments
Posted by ezmobius
Tue, 17 Apr 2007 20:45:00 GMT
I’m really happy to report that my startup company EngineYard.com has been growing at a very rapid pace. We started with 3 people: Lance, Tom and I and now we are up to 9 people total. But this still is not enough! We opened our doors for customers in October of 2006 and we’re a profitable company as of January 2007.
I know a lot of smart folks read my blog here so this is a call to arms. Engine Yard is looking for 2 more employees that know rails and capistrano well. Sysadmin knowledge is also a big plus and knowledge of Linux is a must. You would be working in a very fun company helping us develop our custom internal software and capistrano automation code base. You would also help with customer support and customer code reviews/recommendations. Never a dull day here so you should be comfortable wearing multiple hats and work well under pressure.
This is a full time salaried position with benefits. The cool part is that you can work remotely so you do not have to move to take this job. Our data center and headquarters is in Sacremento but most of our Rails tech people are scattered across the states. In fact it’s a bonus if you live on the east coast or in Europe since the internet never sleeps and we are getting more and more customers from overseas.
You would be working closely with me and my team. You’d get to play with kick ass hardware and work with Rails developers from all over the world to get their apps and deployments all ironed out.
Interested? Shoot me an email with some info on who you are, what your skills are and why you think you would kick ass if we hired you.
ez@engineyard.com
Tags capistrano, deployment, engineyard, scale | 4 comments