rtomayko / mongrel_proctitle

Process title support for Mongrel (GemPlugin)

This URL has Read+Write access

Ryan Tomayko (author)
Sun Mar 01 03:17:23 -0800 2009
commit  f4b47ce20d94455ccf929c842967fc51b84f603b
tree    67655e113e3333d2ac182f713079d85cf86455e1
parent  109c5b3202454dec2e59d2aa8f8d43e7d5ec3b0d
5bec252a » rtomayko 2008-02-26 Update README to include in... 1 Mongrel process title GemPlugin
2 ===============================
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 3
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 4 This is a simple plugin for Mongrel which changes the process title to reflect
5 what it's currently doing. You can then determine a given Mongrel server's
6 status using "ps".
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 7
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 8 For example:
9
9dca0d9e » arya 2009-02-10 Add gemspec, bump version, ... 10 mongrel_rails [10010/2/358]: handling 127.0.0.1: HEAD /feed/cal/global/91/6de4, GET /feed/index
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 11 | | | | | |
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 12 | | | | | The current req (method / path)
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 13 | | | | |
14 | | | | The client IP
15 | | | |
16 | | | What it's doing
17 | | |
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 18 | | Requests processed during server lifetime
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 19 | |
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 20 | Requests currently queued/being processed concurrently
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 21 |
22 The port that Mongrel is serving
23
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 24 This is almost entirely based on Alexander Staubo's Rails plugin with the same
25 name:
26
27 http://purefiction.net/mongrel_proctitle/
28
29 The main difference is that the GemPlugin will automatically be loaded by all
30 mongrels without additional code changes or configuration.
31
5bec252a » rtomayko 2008-02-26 Update README to include in... 32 Monitoring Mongrels
33 -------------------
34
35 Once the program is installed, you should be able to see the formatted process
36 title by running:
37
38 $ ps -axwwo pid,command | grep mongrel_rails
39
40 See ps(1) for more options. You may want to include %cpu, rsz, %mem, or other
41 fields in output.
42
43 There's also a `mongrel_top` executable included in the gem that works like
44 top(1) but displays only mongrel processes:
45
46 $ mongrel_top
47
48 By default, `mongrel_top` updates the display every 0.25 seconds and shows the
49 pid and process title. You can select a different interval and fields with the
50 -s and -o arguments, respectively:
51
52 $ mongrel_top -s 0.1 -o pid,%cpu,rsz,command
53
54 The "command" field must be included.
55
56 Installation
57 ------------
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 58
59 This version of the plugin is packaged specifically as a Mongrel GemPlugin. Install
60 using:
61
868e4196 » rtomayko 2008-02-22 Note that gem should be ins... 62 gem install mongrel_proctitle --source=http://tomayko.com
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 63
64 Once installed, all new mongrels will automatically load the plugin during startup. If
65 you would prefer to control which mongrels load the plugin, do not install this gem.
66 Use the directions below instead.
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 67
5bec252a » rtomayko 2008-02-26 Update README to include in... 68 Installing into a specific Rails app only
69 -----------------------------------------
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 70
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 71 See Alexander Staubo's original project:
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 72
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 73 http://purefiction.net/mongrel_proctitle/
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 74
dadcd72c » JD Harrington 2008-02-28 added support for app-speci... 75 Showing your application-specific revision/release in the title
76 -------------------------------------------------------------------
77
78 In your application's start-up process, re-open Mongrel::Proctitler
79 and define a get_app_revision method. In a Rails app, a good place
80 to do this is in RAILS_ROOT/config/environments/production.rb. An
128da6fe » JD Harrington 2008-02-28 write better english! :) 81 example get_app_revision method might look like:
dadcd72c » JD Harrington 2008-02-28 added support for app-speci... 82
83 def get_app_revision
84 `cat ./REVISION`.chomp
85 end
86
5bec252a » rtomayko 2008-02-26 Update README to include in... 87 License
88 -------
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 89
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 90 I've included the LICENSE file from the original mongrel_proctitle distribution. It is
91 the "New and Simplified BSD License". More information on this license can be found at:
121b2801 » rtomayko 2008-02-22 Initial commit based on Rai... 92
efb8dad8 » rtomayko 2008-02-22 Tweak README and LICENSE an... 93 http://www.opensource.org/licenses/bsd-license.php