Thanks for the suggestions! I did go with Unicorn. It's very simple because it's packaged as a gem, and it seems to do everything you'd want (run and balance between multiple instances, etc.). It just recommends being behind a front end sever because it's optimised for fast clients, so it wants something in front to buffer requests and responses.
I added unicorn to the production group in my Gemfile. I have a basic config.ru (as part of the project repo) that just requires and runs the rack app, then (as part of the deployment scripting) an upstart service definition (I'm on Ubuntu) that populates environment variables with credentials and starts unicorn with command line arguments that specify listen address, environment, etc. That looks like this: https://gist.github.com/chrisberkhout/c7858c0b7ea18169a999 I'm not really confident in my logging setup. I'm just using the shell to append output from unicorn to a log file, which is rotated by logrotate.d, and submitted to a log aggregation service. Unicorn claims to have some features related to logging, but I'm not exactly sure how to use them. Also, I'm not getting much logging output... I suppose that's because the rack env is "production". I'm considering just running in development mode to get more log output and more comprehensive exception handling from Sinatra. Any thoughts? Cheers, Chris On Wed, May 1, 2013 at 10:38 AM, Ben Hoskings <[email protected]> wrote: > Yeah, that's a good idea when they're a small extra piece. > > In this case, they're distinct apps with their own DBs (to postgres via > sequel), and so I want each one to have separate DB credentials, to run as > a separate unix user, etc. > > - Ben > > > > On 1 May 2013 10:35, Andrew Harvey <[email protected]> wrote: > >> I'm a big fan of using config.ru to mount my rack apps next to my rails >> app where it's useful as well. >> >> I've only used it when taking a path and routing to that, so if need to >> work by domain, then a separate unicorn instance is probably the go. >> >> A. >> >> On 30/04/2013, at 5:20 PM, Ben Hoskings <[email protected]> wrote: >> >> We run two production rack/sinatra apps at TC. I recommend nginx + >> unicorn. >> >> This is how I do it (it's badly named; it's not rails-specific): >> https://github.com/conversation/babushka-deps/blob/master/rails.rb#L1-L4 >> >> - Ben >> >> >> >> On 1 May 2013 10:00, Steve H <[email protected]> wrote: >> >>> I've had good luck with Unicorn. I use it with nginx but Apache will >>> work equally well, as you just reverse proxy a port or unix socket. >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby or Rails Oceania" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/rails-oceania?hl=en. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> -- >> Cheers >> Ben >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby or Rails Oceania" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/rails-oceania?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby or Rails Oceania" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/rails-oceania?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Cheers > Ben > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/rails-oceania?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rails-oceania?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
