jump to navigation

mrocstat – Mongrel pROCess title information stats August 18, 2008

Posted by John Dewey in Command Line, Mongrel, Plugins & Gems, Ruby, WebServers.
add a comment

I wrote a little tool which reports Mongrel’s process title information when using the mongrel_proctitle plugin. There is a gem which reports similar information, however, I like bundling utility scripts as SVN externals with my applications.

You can find the script on github.


Disable mongrel mod_proxy_balancer workers via Capistrano August 15, 2008

Posted by John Dewey in Capistrano, Configuration, Deployment, Mongrel, Rails, WebServers.
add a comment

I created a Capistrano task for disabling workers inside a given balancer, from Daniel Wharton’s Deploying Rails post.

Here’s the pastie. BTW I really hate linking off to pastie for these things. Any suggestions?

The task disables the worker, and is not specific to Mongrel.

Multi-App Mongrel Cluster Init Script January 22, 2008

Posted by John Dewey in Capistrano, Configuration, Deployment, Mongrel, Rails.

I found the mongrel_cluster.sh script, everyone uses — doesn’t quite cut it.   Especially, when a system may host several RoR applications.  Why, you ask?  The ability to easily control, and dynamically discover applications is missing.  In most cases, this doesn’t matter.  Especially when the applications are deployed with Capistrano, since it is leveraged for various tasks (including stop, starts, and restarts).

The SAs on the other hand, usually do not use Capistrano (they should!), or have a recent version of the app checked out.  Having a standard init script across all your applications and servers becomes useful.

You get bonus points for dynamically discovering new application installs.We can make certain assumptions in our environment.

We use Capistrano, apps run as the same user,  live under the same base directory, and link to common Subversion Rake tasks.  That enables the use of a generic Rake task to control all RoR applications. Furthermore, the Rake task can be wrapped by a system init script for use under /etc/init.d/.

Track which mongrel handled a request December 26, 2007

Posted by John Dewey in Code, Configuration, Example, Mongrel, Rails, WebServers.
add a comment

I wrote a plugin which collects system information, and returns the data as HTML comments at the bottom of the page. When running multi-system / multi-Mongrel environments, knowing which server and Mongrel handled a request is paramount.

Unfortunately, getting a handle on this information is difficult, since ‘request.port’, ‘request.env[‘HTTP_HOST’], and ‘request.env[‘SERVER_PORT’], display the origin port, when your Mongrels are behind a reverse proxy.

Ezra clued me into a nice hack.You can add the following code to environment.rb, or in our case the plugin’s init.rb.