descriptionreal-time stats for preforking Rack servers
homepage URL
repository URLgit://
last changeWed, 9 Aug 2017 23:50:12 +0000 (9 23:50 +0000)
last refreshWed, 16 Jan 2019 09:47:38 +0000 (16 10:47 +0100)
content tags
= raindrops - real-time stats for preforking Rack servers

Raindrops is a real time stats package to show statistics for Rack HTTP
servers.  It is designed for preforking servers such as Rainbows! and
Unicorn, but should support any Rack HTTP server under Ruby 1.9, 1.8 and
possibly Rubinius (untested) on platforms supporting POSIX shared memory
and compiled with GCC (for atomic builtins).

Raindrops includes a Struct-like Raindrops::Struct class that may be used
standalone to create atomic counters shared across any number of forked
processes under SMP.

== Features

* counters are shared across all forked children and lock-free

* counters are kept on separate cache lines to reduce contention under SMP

* may expose server statistics as a Rack Middleware endpoint
  (default: "/_raindrops")

* middleware displays the number of actively processing and writing
  clients from a single request regardless of which worker process
  it hits.

== Linux-only Extra Features!

* Middleware response includes extra stats for bound TCP and
  Unix domain sockets (configurable, it can include stats from
  other TCP or UNIX domain socket servers).

* TCP socket stats use efficient inet_diag facilities via netlink
  instead of parsing /proc/net/tcp to minimize overhead.
  This was fun to discover and write.

== Install

raindrops requires GCC 4.x (or compatible) or later to support the
atomic builtins (__sync_{add,sub}_and_fetch()).  Atomic operations on
other compilers may be supported if there is demand.

If you're using a packaged Ruby distribution, make sure you have a C
compiler and the matching Ruby development libraries and headers.

If you use RubyGems:

    gem install raindrops

Otherwise grab the latest tarball from:

Unpack it, and run "ruby setup.rb"

== Usage (Rainbows!/Unicorn preload_app=false)

If you're using preload_app=false (the default) in your Rainbows!/Unicorn
config file, you'll need to create the global Stats object before

        require 'raindrops'
        $stats ||=

In your Rack

        use Raindrops::Middleware, :stats => $stats

== Usage (Rainbows!/Unicorn preload_app=true)

If you're using preload_app=true in your Rainbows!/Unicorn
config file, just add the middleware to your stack:

In your Rack

        use Raindrops::Middleware

== Usage (Linux-extras)

To get bound listener statistics under Linux, you need to specify the
listener names for your server.  You can even include listen sockets for
*other* servers on the same machine.  This can be handy for monitoring
your nginx proxy as well.

In your Rack, just pass the :listeners argument as an array of
strings (along with any other arguments).  You can specify any
combination of TCP or Unix domain socket names:

        use Raindrops::Middleware, :listeners => %w( /tmp/.sock)

See the tests/ and examples/ directory for more examples

== Development

You can get the latest source via git from the following locations:

  git:// (mirror)

You may browse the code from the web and download the latest snapshot
tarballs here:

* (cgit)
* (gitweb)

Inline patches (from "git format-patch") to the mailing list are
preferred because they allow code review and comments in the reply to
the patch.

We will adhere to mostly the same conventions for patch submissions as
git itself.  See the Documentation/SubmittingPatches document
distributed with git on on patch submission guidelines to follow.  Just
don't email the git mailing list or maintainer with raindrops patches.

== Contact

All feedback (bug reports, user/development discussion, patches, pull
requests) go to the mailing list:
2017-08-09 Eric Wongraindrops 0.19.0 - Rack 2.x middleware compatibilitymasterv0.19.0
2017-07-25 Dmytro ShteflyukProperly override respond_to? in Raindrops::Middleware...
2017-04-26 Eric Wongtcp_info: remove unnecessary extconf.h include
2017-04-26 Eric WongRuby thread compatibility updates
2017-03-23 Eric Wongraindrops 0.18.0v0.18.0
2017-03-23 Eric Wongaggregate/pmq: update version numbers for Ruby and...
2017-03-23 Eric Wongdoc: document Raindrops::TCP hash
2017-03-23 Eric Wongbuild: avoid olddoc for building the RubyGem
2017-03-23 Eric Wongdoc: update location of TCP_INFO-related stuff
2017-03-20 Eric Wongdoc: remove private email support address
2017-03-18 Eric WongMerge remote-tracking branch 'origin/aggregate-pmq'
2017-03-18 Eric WongMerge remote-tracking branch 'origin/freebsd'
2017-03-18 Eric Wongaggregate/pmq: avoid File#stat allocationaggregate-pmq
2017-03-18 Eric Wongaggregate/pmq: remove io-extra requirement
2017-03-18 Eric Wongaggregate/pmq: avoid false sharing of lock buffers
2017-03-18 Eric Wongavoid reading errno repeatedly
17 months ago v0.19.0 raindrops 0.19.0 - Rack 2.x middlew...
21 months ago v0.18.0 raindrops 0.18.0
2 years ago v0.17.0 raindrops 0.17.0 - rack 2.x updates
2 years ago v0.16.0 raindrops 0.16.0 - minor fixes...
3 years ago v0.15.0 raindrops 0.15.0 - non-glibc compat...
3 years ago v0.14.0 raindrops 0.14.0 - misc doc updates
4 years ago v0.13.0 raindrops 0.13.0 several minor...
5 years ago v0.12.0 raindrops 0.12.0 - compatibility...
5 years ago v0.11.0 raindrops 0.11.0 - minor fixes...
6 years ago v0.10.0 raindrops 0.10.0 - minor feature...
6 years ago v0.9.0 raindrops 0.9.0 - minor middleware...
6 years ago v0.8.1 raindrops 0.8.1 - compatibility...
7 years ago v0.8.0 raindrops 0.8.0 - watcher updates
7 years ago v0.7.0 raindrops 0.7.0 - FreeBSD fix,...
7 years ago v0.6.1 raindrops 0.6.1 - fix build on...
7 years ago v0.6.0 raindrops 0.6.0 - polishing up...
17 months ago master
22 months ago aggregate-pmq
22 months ago freebsd
5 years ago gc-next