rtomayko / mongrel_proctitle
- Source
- Commits
- Network (6)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
f4b47ce
Ryan Tomayko (author)
Sun Mar 01 03:17:23 -0800 2009
commit f4b47ce20d94455ccf929c842967fc51b84f603b
tree 67655e113e3333d2ac182f713079d85cf86455e1
parent 109c5b3202454dec2e59d2aa8f8d43e7d5ec3b0d
tree 67655e113e3333d2ac182f713079d85cf86455e1
parent 109c5b3202454dec2e59d2aa8f8d43e7d5ec3b0d
mongrel_proctitle / README
| 5bec252a » | rtomayko | 2008-02-26 | 1 | Mongrel process title GemPlugin | |
| 2 | =============================== | ||||
| 121b2801 » | rtomayko | 2008-02-22 | 3 | ||
| efb8dad8 » | rtomayko | 2008-02-22 | 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 | 7 | ||
| efb8dad8 » | rtomayko | 2008-02-22 | 8 | For example: | |
| 9 | |||||
| 9dca0d9e » | arya | 2009-02-10 | 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 | 11 | | | | | | | | |
| efb8dad8 » | rtomayko | 2008-02-22 | 12 | | | | | | The current req (method / path) | |
| 121b2801 » | rtomayko | 2008-02-22 | 13 | | | | | | | |
| 14 | | | | | The client IP | ||||
| 15 | | | | | | ||||
| 16 | | | | What it's doing | ||||
| 17 | | | | | ||||
| efb8dad8 » | rtomayko | 2008-02-22 | 18 | | | Requests processed during server lifetime | |
| 121b2801 » | rtomayko | 2008-02-22 | 19 | | | | |
| efb8dad8 » | rtomayko | 2008-02-22 | 20 | | Requests currently queued/being processed concurrently | |
| 121b2801 » | rtomayko | 2008-02-22 | 21 | | | |
| 22 | The port that Mongrel is serving | ||||
| 23 | |||||
| efb8dad8 » | rtomayko | 2008-02-22 | 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 | 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 | 58 | ||
| 59 | This version of the plugin is packaged specifically as a Mongrel GemPlugin. Install | ||||
| 60 | using: | ||||
| 61 | |||||
| 868e4196 » | rtomayko | 2008-02-22 | 62 | gem install mongrel_proctitle --source=http://tomayko.com | |
| efb8dad8 » | rtomayko | 2008-02-22 | 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 | 67 | ||
| 5bec252a » | rtomayko | 2008-02-26 | 68 | Installing into a specific Rails app only | |
| 69 | ----------------------------------------- | ||||
| 121b2801 » | rtomayko | 2008-02-22 | 70 | ||
| efb8dad8 » | rtomayko | 2008-02-22 | 71 | See Alexander Staubo's original project: | |
| 121b2801 » | rtomayko | 2008-02-22 | 72 | ||
| efb8dad8 » | rtomayko | 2008-02-22 | 73 | http://purefiction.net/mongrel_proctitle/ | |
| 121b2801 » | rtomayko | 2008-02-22 | 74 | ||
| dadcd72c » | JD Harrington | 2008-02-28 | 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 | 81 | example get_app_revision method might look like: | |
| dadcd72c » | JD Harrington | 2008-02-28 | 82 | ||
| 83 | def get_app_revision | ||||
| 84 | `cat ./REVISION`.chomp | ||||
| 85 | end | ||||
| 86 | |||||
| 5bec252a » | rtomayko | 2008-02-26 | 87 | License | |
| 88 | ------- | ||||
| 121b2801 » | rtomayko | 2008-02-22 | 89 | ||
| efb8dad8 » | rtomayko | 2008-02-22 | 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 | 92 | ||
| efb8dad8 » | rtomayko | 2008-02-22 | 93 | http://www.opensource.org/licenses/bsd-license.php | |
