It might have been blazingly obvious to others but I only just got my head around what a production setup of Merb involves. After wrecking my head dreaming up custom rackup files to run vendor’d edge Merb I finally realised I was thinkin old-skool.
Your typical Rails stack goes balancer → mongrel → Rails.
I naively went upon setting up something similar for a production Merb app: balancer to thin to Merb. This actually works just fine thanks to thin’s baked-in support for Merb… but it’s not really what you want. You’ll also find it hard to use frozen Merb.
Thanks to geniuses that are ezra and yehuda, to run merb in production is actually the same as development—you use merb!
Merb itself hooks up to which ever adapter you want it to speak to the web through… whether it be mongrel, thin, ebb or mycoolnewrackhandler.
so… what you really want to do is: balancer → Merb → thin.
A nice Merb deployment recipe that’s ticking along for me nicely at the moment:
- nginx for vhosting, asset serving and proxying to the merb instances
- merb booted using merb-manage
- the thin merb adapter
Soon I’ll chuck in haproxy for load balancing across merb instances.
Archived comments
Comments were previously allowed on articles. Though no new comments are being accepted you can see the old comments below.
-
Bahumbug. Nothing related to deployment is “blazingly obvious” :) All articles on the topic are justified.
-
Would thin’s support for unix socket connections still work in this setup do you think?
-
@hugh you can use unix socket w/ thin form the merb script by specifying a path to a socket file for the -h option:
merb -a thin -h /tmp/thin.sock
-
@marcournoyer awesome, thin rocks. Thanks :)
-
I know this comment is side tracking a little, but passenger (mod_rails) now supports rack. Have you thought about using that?