memcache.php stats like apc.php
by Harun Yayli on Wednesday, May 21st, 2008 at 5:15 pm under Memcached, PHP, Programming
For a long time I was looking for a nice web interface like the apc.php (comes with the apc’s source) that displays whole nine yards of stats. The only good tool is memcache-tool from the danga guys. It’s quite complete but I guess I’m too lazy to go on the command line.
Anyways, I decided to rip write my own. Totally based on the original apc.php (I even recycled some functions) and apart from completeness, here is a memcache.php that you can get stats and dump from multiple memcache servers.
Here is a screenshot:

And here is the the source code.
As usual, this piece of software comes with the warnings:
- Don’t expect something complete, might have bugs and security problems etc.
- Do not install on a prod environment unless you’re sure!
- Feel free to add stuff to it, I’ll put it to google code or sf.net soon.
- Feel free to request features. (no I’m not planning a backup tool , there is memcache-tool for that)
- Enjoy!
Update: Small parse error is fixed
Recent Entries
- memcache.php can delete keys now
- memcache.php is now part of pecl/memcache
- memcache.php goes PECL
- memcache.php stats like apc.php
- oci_bind_by_name maxlength is not so optional
- Is Sun going to buy PHP too?(PHP Quebec 2008)
- PHP APC apc_shm_create error on CLI
- Facebook’s Buggy Spam Detection
- Is it Firefox or Zend Debugger? Cookie Standards
- ezComponents ready for prod?
That’s very useful, thanks for publishing it.
By the way you have an extra comma (,) in the source code around line 486.
May 21st, 2008 at 10:47 pmHey Harun,
Just a small problem with the code - it throws an error while running. The comma on line 486 has to be a semi-colon. Changing that fixes the problem.
Cool Script btw !
May 22nd, 2008 at 2:28 amHave you talked to the pecl/memcache maintainers to get this script included into the package just like with pecl/apc?
May 22nd, 2008 at 2:59 amNice script!
There is a parse error on line 488, “menu_entry(2,’Variables’), ” should be “menu_entry(2,’Variables’);”
May 22nd, 2008 at 4:12 amHi, this is pretty cool, thanks for sharing!
May 22nd, 2008 at 8:37 amregards, dz
Do you know of anything like this for Postgres?
May 22nd, 2008 at 8:56 am@James McGlinn, @Vinu Thomas, @Jason,
May 22nd, 2008 at 9:57 amThanks for noticing, parse error should be fixed now.
@Lukas
May 22nd, 2008 at 10:00 amGood idea. I’ll contact them to contribute the code to the pecl/memcache.
@Glen
May 22nd, 2008 at 10:07 amHmm.. No I’m not a Postres user at all.
No chance for a txt/tarball download? Pasting a phps file is always so ugly
May 22nd, 2008 at 12:20 pm@Trophaeum
May 22nd, 2008 at 12:49 pmDone
What about a mysql version then?
May 22nd, 2008 at 2:41 pm@Glen
May 22nd, 2008 at 3:08 pmThere are way too many tools for mysql. Mysql Administrator is really great too (http://www.mysql.com/products/tools/administrator/). I don’t really have a good idea that is not covered by MysqlAdministrator.
Awesome script. Thanks so much.
July 25th, 2008 at 3:44 pmBTW, I made one small change to the codebase
I changed this line:
Header(”WWW-Authenticate: Basic realm=\”APC Login\”");
to this:
Header(”WWW-Authenticate: Basic realm=\”Memcache Login\”");
I actually have APC devices in my network and thought it was a little confusing. Anyway thanks so much. This is much easier to keep dibs on my memory servers than using the command line all the time.
July 25th, 2008 at 3:46 pmThanks,
I’ve added a flush cache link, fixed the ‘evicted’ text and made HTTP auth optional. Where do I send the patch?
July 30th, 2008 at 8:02 pm@michael.
Thank you. I’ve recently corrected those too.
August 2nd, 2008 at 4:31 pmYou can contact me by email. see the About page.
great script. perfect for keeping an eye on memcached!
August 9th, 2008 at 3:55 am