descriptionreal-time stats for preforking Rack servers
homepage URLhttp://raindrops.bogomips.org/
repository URLgit://git.bogomips.org/raindrops.git
ownerraindrops@bogomips.org
last changeSun, 7 Sep 2014 07:08:46 +0000
last refreshThu, 02 Oct 2014 15:33:33 +0200
Content tags:
Add:
readme
= 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:

http://raindrops.bogomips.org/files/

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
forking.

        require 'raindrops'
        $stats ||= Raindrops::Middleware::Stats.new

In your Rack config.ru:

        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 config.ru:

        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 config.ru, 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(0.0.0.0:80 /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://git.bogomips.org/raindrops.git
  git://repo.or.cz/raindrops.git (mirror)

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

* http://git.bogomips.org/cgit/raindrops.git (cgit)
* http://repo.or.cz/w/raindrops.git (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: mailto:raindrops@librelist.com
shortlog
2014-09-07 Eric Wonglinux_inet_diag: annotate memory freeing on diag errorsmaster
2014-02-18 Eric Wongraindrops 0.13.0 several minor fixes and improvementsv0.13.0
2014-02-18 Eric Wonglicense: use LGPLv2.1 or later (was LGPL (2.1|3.0)...
2014-02-18 Eric Wonglinux_inet_diag: fix Ruby 2.2 (dev) build
2014-02-18 Eric Wongraindrops.gemspec: add wrongdoc dev dependency
2013-11-05 Eric Wonglast_data_recv: do not assume Unicorn includes all...
2013-11-05 Eric WongRakefile: remove raa_update task
2013-09-13 Hleb ValoshkaRemove Scope IDs from IPv6 addresses.
2013-09-02 Eric Wongraindrops 0.12.0 - compatibility fixesv0.12.0
2013-09-02 Eric Wongtest_watcher: fix for Ruby trunk r40195 and later
2013-08-31 Eric Wonglinux_inet_diag: improve compatibility with newer GCs
2013-08-28 Eric Wongextconf: try harder for gcc atomics in i386-configured...
2013-04-20 Eric WongREADME: update regarding Ruby support status
2013-04-20 Eric Wongdoc: add email address to generated doc/site
2013-04-20 Eric Wongraindrops 0.11.0 - minor fixes improvementsv0.11.0
2013-04-20 Eric Wonglinux_inet_diag: better align listener_stats struct
...
tags
7 months ago v0.13.0 raindrops 0.13.0 several minor...
12 months ago v0.12.0 raindrops 0.12.0 - compatibility...
17 months ago v0.11.0 raindrops 0.11.0 - minor fixes...
2 years ago v0.10.0 raindrops 0.10.0 - minor feature...
2 years ago v0.9.0 raindrops 0.9.0 - minor middleware...
2 years ago v0.8.1 raindrops 0.8.1 - compatibility...
2 years ago v0.8.0 raindrops 0.8.0 - watcher updates
3 years ago v0.7.0 raindrops 0.7.0 - FreeBSD fix,...
3 years ago v0.6.1 raindrops 0.6.1 - fix build on...
3 years ago v0.6.0 raindrops 0.6.0 - polishing up...
3 years ago v0.5.0 raindrops 0.5.0 - more Linux extras!
4 years ago v0.4.1 raindrops 0.4.1 - more portability!
4 years ago v0.4.0 raindrops 0.4.0 - flowing into...
4 years ago v0.3.0 raindrops v0.3.0 - LGPL v2.1 and...
4 years ago v0.2.0 raindrops 0.2.0 - raining penguins!
4 years ago v0.1.0 raindrops 0.1.0
heads
3 weeks ago master
15 months ago gc-next