1.查memcache状态
/usr/bin/perl /usr/local/src/memcached-1.4.5/scripts/memcached-tool localhost:11211
或者
telnet localhost 11211

2.手动清除memcached测试

1). flush_all
  echo "flush_all" | nc localhost 11211

# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
get var_key
VALUE var_key 0 13
test variable
END
flush_all
OK
get var_key
END
quit
Connection closed by foreign host.

2). 重启memcached进程
 kill $(ps aux|grep memcached|grep -v grep |awk '{print $2}')
/usr/local/memcached/bin/memcached -d -m 256 -p 11211 -u nobody

3)Memcache::flush() immediately invalidates all
existing items.

/* procedural API */
$memcache_obj = memcache_connect('memcache_host', 11211);
memcache_flush($memcache_obj);
/* OO API */
$memcache_obj = new Memcache;
$memcache_obj->connect('memcache_host', 11211);
$memcache_obj->flush();
?>

这个测试的表现是请求Memcache::flush()以后仍可以get $key取到值,而且通过memcached-tool 查到该item的max_age并无变化.

参考链接
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0

理解 Memcache 的服务器端与客户端

http://www.studyday.net/2011/07/261

手动清除memcached缓存方法的更多相关文章

  1. C语言清除输入缓存方法记录[转]

    原文:http://www.tomytime.com/archives/218/ fflush()函数是标准的作法. setbuf(stdin,NULL)是GCC下可用的一种方法. scanf(&qu ...

  2. 清除memcached缓存

    telnet localhost 11211 flush_all 最后要一定要关闭dos窗体,不然会导致memcached写值返回ture,但是实际上并没有写入值

  3. memcached缓存:安装和清缓存

    一.安装步骤: 1.将工具一直解压,解压到最底层的exe目录

  4. Android手机清除微信缓存

    方法一: 1.任意找一个微信好友,给他发送网址 http://debugx5.qq.com 2.自己点击这个网址跳转 3.进入后看到下面的页面,通过勾选第二张截图的Cookie和文件缓存来清除微信缓存 ...

  5. Chrome清除dns缓存

    Chrome清除dns缓存 为了加快访问速度,Google Chrome浏览器采用了预提DNS记录,在本地建立DNS缓存的方法,加快网站的连接速度.你在谷歌Chrome浏览器的地址栏中输入about: ...

  6. JS 清除IE缓存

    js中自动清除ie缓存方法 — 常用 对于动态文件,比如 index.asp?id=...  或者 index.aspx?id=... 相信有经验的程序员都知道怎样禁止浏览器缓存数据了.  但是对于静 ...

  7. vue项目强制清除页面缓存

    异常描述: 支付宝中内嵌h5项目(vue框架开发),前端重新打包上传之后访问页面会导致页面空白.页面tab点击异常之类异常情况,需要手动清除支付宝缓存才可以正常访问. 解决方案: 在HTTP协议中,只 ...

  8. linux 缓存手动清除

    linux下怎么清理缓存 free -m 命令可以查看内存使用情况                   sysctl 命令可以临时改变某个系统参数  如:sysctl -w net.ipv4.ip_f ...

  9. js清除浏览器缓存的几种方法

    2014年9月24日 4692次浏览 关于浏览器缓存 浏览器缓存,有时候我们需要他,因为他可以提高网站性能和浏览器速度,提高网站性能.但是有时候我们又不得不清除缓存,因为缓存可能误事,出现一些错误的数 ...

随机推荐

  1. C++ 输出Cstring遇见的奇葩问题

    先上代码 // webConteng.cpp : Defines the entry point for the console application. // #include "stda ...

  2. drawRect & 内存 -> 深究

    转载自:http://bihongbo.com/2016/01/03/memoryGhostdrawRect/ 在平日的开发中,随意覆盖drawRect方法,稍有不慎就会让你的程序内存暴增.下面我们来 ...

  3. ant调用shell命令(Ubuntu)

    ant中调用Makefile,使用shell中的make命令 <?xml version="1.0" encoding="utf-8" ?> < ...

  4. hrbustoj 2033 A Funny Game(对称博弈)

    对称博弈,注释在代码里 #include<iostream> #include<cstdio> using namespace std; ///这个地方其实是博弈原理里面的对称 ...

  5. linux安装安卓开发工具android studio

    http://www.android-studio.org/ http://android-studio.org/index.php/docs/guide 最近要接触android编程,本来想装ecl ...

  6. Struts2--带参数的结果集

    带参数的结果集: 配置文件: <result type="redirect">/user_success.jsp?t=${type}</result> js ...

  7. eclipse proxy

    -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.ht ...

  8. Android学习笔记之Intent(2)

    打开网页 package com.jiahemeikang.helloandroid; import java.io.File; import com.jiahemikang.service.Echo ...

  9. 鼠标滚轮事件 onmousewheel

    1.fiefox:DOMMouseScroll               detail      detail*(-40)=wheelDelta 除了firefox之外:mousewheel     ...

  10. 史上最强php生成pdf文件,html转pdf文件方法

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...