linux-listener-stats: do not load aggregate for single snapshot
[raindrops.git] / README
blob05b6eee22470f7cdbc661a7f237bb41a73dda007
1 = raindrops - real-time stats for preforking Rack servers
3 Raindrops is a real time stats package to show statistics for Rack HTTP
4 servers.  It is designed for preforking servers such as Rainbows! and
5 Unicorn, but should support any Rack HTTP server under Ruby 1.9, 1.8 and
6 Rubinius on platforms supporting POSIX shared memory.
8 Raindrops includes a Struct-like Raindrops::Struct class that may be used
9 standalone to create atomic counters shared across any number of forked
10 processes under SMP.
12 == Features
14 * counters are shared across all forked children and lock-free
16 * counters are kept on separate cache lines to reduce contention under SMP
18 * may expose server statistics as a Rack Middleware endpoint
19   (default: "/_raindrops")
21 * middleware displays the number of actively processing and writing
22   clients from a single request regardless of which worker process
23   it hits.
25 == Linux-only Extra Features!
27 * Middleware response includes extra stats for bound TCP and
28   Unix domain sockets (configurable, it can include stats from
29   other TCP or UNIX domain socket servers).
31 * TCP socket stats use efficient inet_diag facilities via netlink
32   instead of parsing /proc/net/tcp to minimize overhead.
33   This was fun to discover and write.
35 Users of older Linux kernels need to ensure that the the "inet_diag"
36 and "tcp_diag" kernel modules are loaded as they do not autoload correctly
38 == Install
40 We recommend GCC 4+ (or compatible) to support the
41 {atomic builtins}[http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html]
42 (__sync_{add,sub}_and_fetch()).  For non-GCC 4+ users, we also support
43 compilation with the
44 {libatomic_ops}[http://www.hpl.hp.com/research/linux/atomic_ops/]
45 package starting with Raindrops 0.4.0.
47 If you're using a packaged Ruby distribution, make sure you have a C
48 compiler and the matching Ruby development libraries and headers.
50 If you use RubyGems:
52     gem install raindrops
54 Otherwise grab the latest tarball from:
56 http://raindrops.bogomips.org/files/
58 Unpack it, and run "ruby setup.rb"
60 == Usage (Rainbows!/Unicorn preload_app=false)
62 If you're using preload_app=false (the default) in your Rainbows!/Unicorn
63 config file, you'll need to create the global Stats object before
64 forking.
66         require 'raindrops'
67         $stats ||= Raindrops::Middleware::Stats.new
69 In your Rack config.ru:
71         use Raindrops::Middleware, :stats => $stats
73 == Usage (Rainbows!/Unicorn preload_app=true)
75 If you're using preload_app=true in your Rainbows!/Unicorn
76 config file, just add the middleware to your stack:
78 In your Rack config.ru:
80         use Raindrops::Middleware
82 == Usage (Linux-extras)
84 To get bound listener statistics under Linux, you need to specify the
85 listener names for your server.  You can even include listen sockets for
86 *other* servers on the same machine.  This can be handy for monitoring
87 your nginx proxy as well.
89 In your Rack config.ru, just pass the :listeners argument as an array of
90 strings (along with any other arguments).  You can specify any
91 combination of TCP or Unix domain socket names:
93         use Raindrops::Middleware, :listeners => %w(0.0.0.0:80 /tmp/.sock)
95 See the tests/ and examples/ directory for more examples.
97 If you're running Unicorn 0.98.0 or later, you don't have to pass in
98 the :listeners array, Raindrops will automatically detect the listeners
99 used by Unicorn master process.
101 == Development
103 You can get the latest source via git from the following locations:
105   git://bogomips.org/raindrops.git
106   git://repo.or.cz/raindrops.git (mirror)
108 You may browse the code from the web and download the latest snapshot
109 tarballs here:
111 * http://bogomips.org/raindrops.git (cgit)
112 * http://repo.or.cz/w/raindrops.git (gitweb)
114 Inline patches (from "git format-patch") to the mailing list are
115 preferred because they allow code review and comments in the reply to
116 the patch.
118 We will adhere to mostly the same conventions for patch submissions as
119 git itself.  See the Documentation/SubmittingPatches document
120 distributed with git on on patch submission guidelines to follow.  Just
121 don't email the git mailing list or maintainer with raindrops patches.
123 raindrops is currently dual-licensed under the LGPLv2.1 and LGPLv3.  To
124 allow for a transition to future versions of the LGPL, contributors are
125 required to sign-off changes allowing allowing the project leader to
126 relicense raindrops under newer versions of the LGPL (which should be
127 similar in spirit to the existing LGPL).
129 == Contact
131 All feedback (bug reports, user/development discussion, patches, pull
132 requests) go to the mailing list: mailto:raindrops@librelist.com
134 The mailing list is mirrored to Gmane, all information about the
135 group is here:
137 http://gmane.org/info.php?group=gmane.comp.lang.ruby.raindrops.general
139 Mailing list archives in mbox format may be downloaded here:
141 http://raindrops.bogomips.org/archives/