{"id":20119587,"url":"https://github.com/box/memsniff","last_synced_at":"2026-03-10T20:02:55.726Z","repository":{"id":49375575,"uuid":"82112169","full_name":"box/memsniff","owner":"box","description":"A tool for recording and displaying statistics on memcached traffic written in golang.","archived":false,"fork":false,"pushed_at":"2021-03-23T01:30:37.000Z","size":1113,"stargazers_count":144,"open_issues_count":3,"forks_count":18,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-09T13:46:51.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/box.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T22:13:40.000Z","updated_at":"2025-03-05T08:23:26.000Z","dependencies_parsed_at":"2022-08-25T08:02:35.993Z","dependency_job_id":null,"html_url":"https://github.com/box/memsniff","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fmemsniff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fmemsniff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fmemsniff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fmemsniff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/box","download_url":"https://codeload.github.com/box/memsniff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252703454,"owners_count":21790887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T19:16:12.637Z","updated_at":"2026-03-10T20:02:50.694Z","avatar_url":"https://github.com/box.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memsniff\n\n[![Project Status](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges)[![Build Status](https://travis-ci.org/box/memsniff.svg?branch=master)](https://travis-ci.org/box/memsniff)[![Go Report Card](https://goreportcard.com/badge/github.com/box/memsniff)](https://goreportcard.com/report/github.com/box/memsniff)\n\nMemsniff displays the busiest keys being retrieved from your memcache server.\nIt has been inspired by the earlier [mctop](https://github.com/etsy/mctop) and\n[memkeys](https://github.com/tumblr/memkeys) tools.\n\nLike its predecessors, memsniff listens to network traffic and identifies\nresponses to `get` requests, and is usually run directly on a memcache server\nhost.\n\nYou can see our announcement\n[here](https://blog.box.com/blog/introducing-memsniff-robust-memcache-traffic-analyzer/).\n\n\n## Installation\n\nBefore building you'll need to have the libpcap library and headers installed.\n\nOn Redhat-based distributions:\n\n```shell\n# yum install libpcap-devel\n```\n\nOr on Debian-based distributions:\n\n```shell\n# apt-get update \u0026\u0026 apt-get install libpcap-dev\n```\n\nMemsniff uses the\n[standard golang toolchain](https://golang.org/doc/install),\nwhich makes installation simple.\nOnce you have the toolchain installed and `$GOPATH` pointed to your working\ndirectory:\n\n```shell\n$ go get github.com/box/memsniff\n$ go build github.com/box/memsniff\n```\n\nYou will find a compiled binary at `$GOPATH/bin/memsniff`,\nready to be transferred to your Memcache\nhosts or packaged in your distribution's preferred format.\n\n\n## Usage\n\nOn most operating systems `memsniff` requires superuser privileges to capture\nnetwork traffic from an interface, which you specify with the `-i` option.\n\n```shell\n# memsniff -i eth0\n```\n\nSee `-h` for more command-line options.  Once running a few more keys are\nactive:\n\n* `p` - Pause the updating of the display. Press `p` again to resume.\n* `q` - Exit `memsniff`.\n\n\n## Roadmap\n\n* Support binary memcached protocol\n* Support additional operations beyond GET\n* Support alternate sorting methods\n* Create a stable report format for output to disk\n* Automatic logging to disk when specified conditions are met (e.g. aggregate\n  or single key traffic exceeds a threshold)\n* Break out traffic by client IP\n* Supply build support for common package formats (`.deb`, `.rpm`, \u0026hellip;)\n\n\n## Developing memsniff\n\nWant to contribute? First have a look at\n[CONTRIBUTING.md](https://github.com/box/memsniff/blob/master/CONTRIBUTING.md).\n\n#### Running the tests\n\n`memsniff` uses the standard Go testing framework:\n\n```shell\n$ go test ./...\n?   \tgithub.com/box/memsniff\t[no test files]\n...\nok  \tgithub.com/box/memsniff/vendor/github.com/spf13/pflag\t0.067s\n```\n\n\n#### Data pipeline\n\n1. Raw packets are captured on the main thread from `libpcap` using\n   [GoPacket](https://www.github.com/google/gopacket).\n2. Batches of raw packets are sent to the decode pool, where workers parse the\n   memcached protocol looking for responses to `get` requests.  The key and\n   size of the value returned are extracted into a response summary.\n3. Batches of response summaries are sent to the analysis pool where the stream\n   is hash partitioned by cache key and sent to workers. Each worker maintains\n   a hotlist of the busiest keys in its hash partition.\n4. In response to periodic requests from the UI, the analysis pool merges\n   reports from all its workers into a single sorted hotlist, which is\n   displayed to the user.\n\n\n## Support\n\nNeed to contact us directly? Email oss@box.com and be sure to include the name\nof this project in the subject.\n\n\n## Copyright and License\n\nCopyright 2017 Box, Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox%2Fmemsniff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbox%2Fmemsniff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox%2Fmemsniff/lists"}