Home > Backend Development > PHP Tutorial > The easiest way to clear memcache_PHP tutorial

The easiest way to clear memcache_PHP tutorial

WBOY
Release: 2016-07-13 10:36:13
Original
1115 people have browsed it

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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template