Swiftiply is a highly optimized clustering proxy for web applications (currently supports: Rails, Merb, IOWA, Ramaze, Camping, and Nitro, with the ability to support many more). It increases application performance in a few ways. First, it uses EventMachine for network traffic (eventmachine is an
... [More] event-based asynchronous network library which uses epoll on Linux for high network performance). Secondly, it reverses the way Proxies normally work by letting the nodes in the pool connect to Swiftiply with persistent TCP connections. This removes the delay of having to create a new TCP connection for every request, and makes it easier to maintain your cluster since nodes can be added and removed from the pool simply by starting new processes on a server. [Less]
Summarymrnginx stands for mongrel_cluster rails nginx. It's a helper script which makes configuring multiple Rails sites with mongrel_cluster and nginx ridiculously easy.
Currently, this script is configured for Ubuntu Server, however with a little tweaking it should work on other distros.
Here's what it does:
creates mongrel_cluster YAML configuration file symlinks this file to /etc/mongrel_cluster creates nginx vhost file overwrites (and backs up) nginx configuration file (/etc/nginx/nginx.conf) restarts mongrel_cluster restarts nginx Before it does anything, it will list what it is about to do and await your confirmation.
Prerequisitesrubygems (to install the following gems) apt-get rubygems (on Ubuntu) mongrel gem install mongrel mongrel_cluster gem install mongrel_cluster nginx apt-get nginx Example usagecd /var/www/apps/myrailsapp
mrnginx -s myrailsapp.com,myrailsapp.netThat's it! (Except DNS configuration of course).
Note: you'll probably need to run it as root (or sudo mrnginx).
mrnginx -h will display this:
Usage: mrnginx [options]
-e, --environment ENV Rails environment to run as
-p, --port PORT Starting port to bind as
[default next unused port after 8000 + 10]
-a, --address ADDR Address to bind to
-c, --chdir PATH Change to dir before starting (will be expanded)
[default current working directory]
-s DOMAIN1,DOMAIN2 Domain(s) for virtual host
--server-names [default localhost]
-N, --num-servers INT Number of Mongrel servers
--user User to run as.
--group Group to run as.
-h, --help Show this message
-v, --version Show versionAuthorZubin Henner [Less]