npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

memcached-usage

v0.9.0

Published

Readme

Memcached Usage

memcached-usage is a tool can help analyzing memcached memory usage in various scenarios.

How it works

memcached-usage will spawn a memcached server, fill it up with varying or particular size values, and output a usage report. With the usage report, you can fine tune the related settings e.g. chunk_size, growth_factor. This bundle also included some test scenarios, check it out before write your own.

Requirement

  • memcached
  • node
  • npm

Installation

clone this repo

git clone [email protected]:tarkus/memcached-usage.git

install the dependencies with npm

cd memcached-usage
npm install`

now you are ready to run the test scenario

node run.js

A Peek at Memcached's Memory Management

Slabs

Slab is the way memcached used to allocate chunks, basically, they are representing different sizes memory chunks. When you request memory, memcached will calculate the chunk size based on the settings of chunk_size and growth_factor, then give you whether a free chunk or create a new slab class, in closest size.

Useful Command

  • stats - general information
  • stats slabs - useful information dedicated on slabs class and slab usage.
  • stats settings - some settings can be set using command options, man memcached for details

Tools

You can use memcache-top to monitor memcached status.

Reference

Memcached protocol

Analysis

Set the fixture size and run through the test, I figure out,

  • if only store fixed size objects, the usage are too dynamical, in range from 50% up to 98%, it's depend on the object size, chunk_size, and growth_factor, the best fit object produces highest usage.

  • if store small objects in varying size, you can get average usage near 93%

Conclusion

  • Storing fixed size objects in memcached is very tricky, you need to carefully adjust the chunk_size and growth_factor to match the object size.

  • Using memcached as a pool to store varying size objects is the mature way.

  • Avoiding store big objects into memcached. Besides memcached's 1MB hard limit on object size, you need very special settings to reduce the wasted memory. The usage of store big objects is much lower than store small ones.