github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

rtomayko / mongrel_proctitle

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 33
    • 6
  • Source
  • Commits
  • Network (6)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • f4b47ce20d94455ccf929c842967fc51b84f603b
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Process title support for Mongrel (GemPlugin) — Read more

  cancel

http://github.com/rtomayko/mongrel_proctitle/tree/master/README

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Bump version to 1.4 
rtomayko (author)
Sun Mar 01 03:17:23 -0800 2009
commit  f4b47ce20d94455ccf929c842967fc51b84f603b
tree    67655e113e3333d2ac182f713079d85cf86455e1
parent  109c5b3202454dec2e59d2aa8f8d43e7d5ec3b0d
mongrel_proctitle /
name age
history
message
file .gitignore Fri Feb 22 20:41:56 -0800 2008 Now tracking .gitignore [rtomayko]
file LICENSE Fri Feb 22 20:00:04 -0800 2008 Tweak README and LICENSE and bump version to 1.... [rtomayko]
file README Mon Feb 23 12:52:30 -0800 2009 Use gemspec from Rakefile [rtomayko]
file Rakefile Mon Feb 23 12:52:30 -0800 2009 Use gemspec from Rakefile [rtomayko]
directory bin/ Wed Feb 27 11:35:54 -0800 2008 Clean up process title as reported by ps [rtomayko]
directory lib/ Sun Mar 01 03:09:07 -0800 2009 add init.rb file for whatever reason [rtomayko]
file mongrel_proctitle.gemspec Sun Mar 01 03:17:23 -0800 2009 Bump version to 1.4 [rtomayko]
README
Mongrel process title GemPlugin
===============================

This is a simple plugin for Mongrel which changes the process title to reflect
what it's currently doing. You can then determine a given Mongrel server's 
status using "ps". 

For example:

  mongrel_rails [10010/2/358]: handling 127.0.0.1: HEAD /feed/cal/global/91/6de4, GET /feed/index
                 |     | |     |        |          |
                 |     | |     |        |          The current req (method / path)
                 |     | |     |        |
                 |     | |     |        The client IP
                 |     | |     |
                 |     | |     What it's doing
                 |     | |     
                 |     | Requests processed during server lifetime
                 |     |
                 |     Requests currently queued/being processed concurrently
                 |
                 The port that Mongrel is serving

This is almost entirely based on Alexander Staubo's Rails plugin with the same 
name:

http://purefiction.net/mongrel_proctitle/

The main difference is that the GemPlugin will automatically be loaded by all
mongrels without additional code changes or configuration.

Monitoring Mongrels
-------------------

Once the program is installed, you should be able to see the formatted process
title by running:

    $ ps -axwwo pid,command | grep mongrel_rails

See ps(1) for more options. You may want to include %cpu, rsz, %mem, or other
fields in output.

There's also a `mongrel_top` executable included in the gem that works like
top(1) but displays only mongrel processes:

    $ mongrel_top

By default, `mongrel_top` updates the display every 0.25 seconds and shows the
pid and process title. You can select a different interval and fields with the
-s and -o arguments, respectively: 

    $ mongrel_top -s 0.1 -o pid,%cpu,rsz,command

The "command" field must be included.

Installation
------------

This version of the plugin is packaged specifically as a Mongrel GemPlugin. Install 
using:

   gem install mongrel_proctitle --source=http://tomayko.com

Once installed, all new mongrels will automatically load the plugin during startup. If
you would prefer to control which mongrels load the plugin, do not install this gem.
Use the directions below instead.

Installing into a specific Rails app only
-----------------------------------------

See Alexander Staubo's original project:

http://purefiction.net/mongrel_proctitle/

Showing your application-specific revision/release in the title
-------------------------------------------------------------------

In your application's start-up process, re-open Mongrel::Proctitler
and define a get_app_revision method. In a Rails app, a good place
to do this is in RAILS_ROOT/config/environments/production.rb. An
example get_app_revision method might look like:

  def get_app_revision
    `cat ./REVISION`.chomp
  end

License
-------

I've included the LICENSE file from the original mongrel_proctitle distribution. It is
the "New and Simplified BSD License". More information on this license can be found at:

http://www.opensource.org/licenses/bsd-license.php
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server