Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6651481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:01:01+00:00 2026-05-26T01:01:01+00:00

I read this – How does the lazy expiration mechanism in memcached operate? So

  • 0

I read this – How does the lazy expiration mechanism in memcached operate?

So I have a question. Is it possible/recommended to make a program myself that periodically checks for all items in memcached, sending GET requests for each item so that expired items are removed?

The reason I want this is because I want to have a proper control of the used percentage in Memcached. If that percentage is near 100%, I will never be sure if I should add more memory, or if I should not worry because there are many expired items.

I use PHP, and unfortunately this doesn’t return all the items in memcached (no clue why):

    $allSlabs = $memcache->getExtendedStats('slabs');
    foreach ($allSlabs as $server => $slabs) {
        foreach ($slabs as $slabId => $slabMeta) {
            $cdump = $memcache->getExtendedStats('cachedump', (int)$slabId);
            foreach ($cdump as $keys => $arrVal) {
                foreach ($arrVal as $key => $v) {
                    echo $key, "\n";
                }
            }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:01:02+00:00Added an answer on May 26, 2026 at 1:01 am

    You should just use the eviction rate to see if you need to add more memory. The eviction stats will increase if memcached had to throw out an object in order to make room for storing the next one. (and you can look at the “reclaimed” stat to see the number of times we could reclaim the memory for an item to store a new item.

    The code you suggest would jam down the server by dumping its content every now and then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Read this question today about safe and unsafe code I then read about it
I read this question and another question . In one of these two questions,
I read this question here: Is there a way to override the empty constructor
I read this post but I don't really understand the code... I have a
I read this question , which highlights a solution to conditionally insert values into
Having read this past question for git, I would like to ask if there
I read this question and its answer in a book. But I didn't understand
Read this thread but didn't really answer my question and there were quite a
Read this question carefully because I am not asking how to get rid of
I read this and this . But i couldn't find the answer. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.