How to manually clear the memcached cache-use the memcache extension of telnet and PHP

Source: Internet
Author: User
1. check the memcache status/usr/bin/perl/usr/local/memcached/scripts/memcached-toollocalhost: 11211 or telnetlocalhost112112. manually clear memcached test 1). flush_allecho &

1. check the memcache status

/usr/bin/perl /usr/local/memcached/scripts/memcached-tool localhost:11211

Or

telnet localhost 11211

2. manually clear memcached test

1). flush_all

echo "flush_all" | nc localhost 11211# telnet localhost 11211Trying 127.0.0.1...Connected to localhost.localdomain (127.0.0.1).Escape character is '^]'.get var_keyVALUE var_key 0 13test variableENDflush_allOKget var_keyENDquitConnection closed by foreign host.

2) restart the memcached process.

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 ()? Clear all caches immediately.

 connect('memcache_host',?11211);$memcache_obj->flush();?>

In this test, the value of get $ key can still be obtained after Memcache: flush () is requested, and the max_age of the item is not changed through memcached-tool.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.