[Last Call] Learn how to a build a cloud-first strategyRegister Now


Memcache and Slab Size

Posted on 2009-04-20
Medium Priority
Last Modified: 2013-11-14
I'm trying to better understand how memcache's slabs work. Currently I'm storing thousands of very small items in memcache, and many are expiring way too soon. When I look at the stats, it shows memcache still has plenty of available memory.

So I'm wondering.. When memcache receives an item, and decides it should go into slab 7, does it evict items in slab 7 if that slab is full , even though memcache itself still has plenty of available memory? Or does it create a new slab, and store the item in there, leaving the existing items in slab 7 untouched?
Question by:headzoo
  • 3
LVL 23

Expert Comment

ID: 24188834
LVL 23

Expert Comment

ID: 24463326
I object I answer the quesion and did not get a response.

LVL 23

Accepted Solution

ComputerTechie earned 2000 total points
ID: 24463592
if the user used memcache command with -L or -f it would let the user the result the user is looking for.

You can tune the growth factor to reduce this effect by using the -f command line option. This will adapt the growth factor applied to make more effective use of the chunks and slabs allocated. For information on how to determine the current slab allocation statistics, see Section, memcached Slabs Statistics.
If your operating system supports it, you can also start memcached with the -L command line option. With this option enabled, it will preallocate all the memory during startup using large memory pages. This can improve performance by reducing the number of misses in the CPU memory cache.

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question