PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 13, 2022

[FIXED] How do I fix high memcached wasted space?

 November 13, 2022     caching, memcached, sysadmin     No comments   

Issue

We're using a fairly large (20GB), very active (>92% hit rate) Memcache cluster and seeing more than 10% wasted space.

The eviction rate is extremely low (0.1/sec), and the reclaimed rate is flat - 0.

Is this cause for concern, and is there anything that can be done - even periodically - to ensure that is doesn't eat as much usable space as it currently is?


Solution

I recently did an analysis of the space usage of our memcached cluster which is about twice that size.

We found that memcached would typically have "waste" space when it had empty chucks in slabs of various sizes that were simply not filled.

This seems to be a side affect of the fact that slab allocation in memcached < 1.4.11 is static and memory for a certain slab size is only evicted (once allocated) from slabs of the same size.

http://code.google.com/p/memcached/wiki/ReleaseNotes1411

As of 1.4.11 a feature of slab reallocation was introduced, which is supposedly meant to allow the LRU to evict objects from other slabs classes to use on a needed slab class.

I'm not sure what would happen if the eviction rate was such that memory was constantly being evicted and reallocated to and from different slab classes.

Given the low eviction rate however, I would not be overly concerned unless you are experiencing performance problems else where.

Hopefully that helps.



Answered By - alex
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing