Home  >  Article  >  Backend Development  >  The easiest way to clear memcache_PHP tutorial

The easiest way to clear memcache_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:36:131050browse

If you want to clear the items in memcache, what is the common method? Kill and restart? What if there are n memcaches that need to be restarted? Do it one by one?

It’s very simple. Assuming memcached is running on the local port 11211, then run the command line:
$ echo ”flush_all” | nc localhost 11211

Note: Flush does not delete items, it just marks all items as expired.

or

First, connection: telnet 127.0.0.1 11211
Second, press the Enter key
Third, flush_all and then press Enter
The console displays OK, indicating that the operation is successful

Description:
1. Clear all key values ​​
flush_all
Note: Flush does not delete items, it just marks all items as expired, so memcache still occupies all memory at this time.

2. Exit
quit

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/740288.htmlTechArticleIf you want to clear the items in memcache, what is the common method? Kill and restart? What if there are n memcaches that need to be restarted? Do it one by one? It's simple, assuming memcached is running locally...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn