To manually clear the Memcached cache method

Source: Internet
Author: User

1. Check memcache status
/usr/bin/perl/usr/local/src/memcached-1.4.5/scripts/memcached-tool localhost:11211
Or
telnet localhost 11211

2. Manually clear the memcached test

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). Restart the memcached process
Kill $ (PS aux|grep memcached|grep-v grep |awk ' {print $} ')
/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 '

The performance of this test is that the request Memcache::flush () can still get the value after the fetch $key, and the max_age of the item is not changed by Memcached-tool.

Reference links
Microsoftinternetexplorer402documentnotspecified7.8normal0

Understanding Memcache Server-side vs. client

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

To manually clear the Memcached cache method

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.