Git Product home page Git Product logo

mcsauna's Introduction

mcsauna

mcsauna allows you to track the hottest keys on your memcached instances, reporting back in a graphite-friendly format. Regexps can be specified to group similar keys into the same bucket, for high-cardinality memcached instances, or tracking lots of keys over time.

Key rates are reported in the format:

mcsauna.keys.foo: 3

Errors in processing are reported in the format:

mcsauna.errors.bar: 3

If you are using diamond, you can output these to a file and watch via FilesCollector.

Note that at the moment, TCP reassembly / reordering is not supported. This should only be a problem for the case of multigets that span more than one packet. In these cases, an error will be reported indicating the command was truncated.

Arguments

$ ./mcsauna --help
Usage of ./mcsauna:
  -c string
        config file
  -e    show errors in parsing as a metric (default true)
  -i string
        capture interface (default "any")
  -n int
        reporting interval (seconds, default 5)
  -p int
        capture port (default 11211)
  -q    suppress stdout output (default false)
  -r int
        number of items to report (default 20)
  -w string
        file to write output to

Configuration

All command-line options can be specified via a configuration file in json format. Regular expressions and related options can only be specified in config. Command-line arguments will override settings passed in configuration.

Pass a configuration file using -c:

# ./mcsauna -c conf.json

Example configuration:

{
     "regexps": [
         {"re": "^Foo_[0-9]+$", "name": "foo"},
         {"re": "^Bar_[0-9]+$", "name": "bar"},
         {"re": "^Baz_[0-9]+$", "name" "baz"},
     ],
     "interval": 5,
     "interface": "eth0",
     "port": 11211,
     "quiet": false,
     "show_errors": true,
     "output_file": "/tmp/mcsauna.out"
 }

If regexps are specified, individual hot keys will not be reported. If not specifying regular expressions, you can limit the number of items that will be reported:

{
     "interval": 5,
     "num_items_to_report": 20
}

When debugging regular expressions, you can see which keys did not match with the show_unmatched flag set to true.

Known Issues

The attempt to add support for multiple commands per packet caused a performance regression that hasn't been addressed. If you're experiencing this, version 1.0.2 (3dbb6d5179448f40c183cbb489c07d0862b8e57a) is recommended.

mcsauna's People

Contributors

dellis23 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.