1

I am working on a PHP Laravel project as a tester and I am trying to test to make sure that some data in Memcached (running this locally) only expires after 30 days. But I am having trouble figuring out how to identify the expiration date/time of data in Memcached.

I tried using telnet and I am not having much luck there. I tried using a PHP-based Memcache tool. I have also tried a few clients that I found on the web but nothing seems to be working right (loading up without issues). Thoughts?

The PHP-based tool doesn't give an expiration date and I can't seem to access that information anywhere in any of the other tools. My local machine is an Ubuntu 12.10 box.

Patrick
  • 3,302
  • 4
  • 28
  • 47

1 Answers1

1

You cannot retrieve that data from memcached. If you need it, serialize it with the object you are storing.

Here is a question similar to yours with good answers.

Community
  • 1
  • 1
bitgarden
  • 10,461
  • 3
  • 18
  • 25
  • I thought that too until I found a tool called Peep. So I recompiled my memcached to allow debugging. The only problem is that I cannot seem to get the Peep RubyGem installed. I guess it doesn't like my version of Ruby. http://blog.johngoulah.com/2009/06/investigating-memcached/ – Patrick Sep 04 '13 at 18:26
  • If you're only going to use it for testing as your question suggests, that seems reasonable. Keep in mind that peep uses ptrace to do its thing, which has the side effect of freezing your memcached server. Useful for one off debugging, but you most definitely don't want to use it on a prod machine :) http://blog.evanweaver.com/2009/04/20/peeping-into-memcached/ – bitgarden Sep 04 '13 at 19:00
  • Yeah, it is only for testing. If I can just get the dang thing to work now. – Patrick Sep 04 '13 at 20:49