Difference between revisions of "Flush Your Memcached Instance"
From Brian Nelson Ramblings
(Created page with "==How to flush your Memcached Instance== If you need to flush your memcached instance because you have made a change to your website You can running the following command vi...") |
(→Additional Articles) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
or if its setup as a socket | or if its setup as a socket | ||
− | echo "flush_all" | nc /path/to/the/socket.sock | + | echo "flush_all" | nc -U /path/to/the/socket.sock |
You should see the '''OK''' once you run the command, meaning your memcached instance has been flushed | You should see the '''OK''' once you run the command, meaning your memcached instance has been flushed | ||
+ | |||
+ | If you have to run this command often and you do not want to remember the entire statement, you can always create an alias to run | ||
+ | |||
+ | Example, add the following to your .bashrc file | ||
+ | |||
+ | alias flush_memcached='echo "flush_all" | nc localhost 11211' | ||
+ | |||
+ | Or the following to view your stats | ||
+ | |||
+ | alias stats_memcached='echo "stats" | nc 10.70.30.20 11211' | ||
+ | |||
+ | Then run the following to reload your current .bashrc file | ||
+ | |||
+ | source .bashrc | ||
+ | |||
+ | ===Additional Articles === | ||
+ | |||
+ | * [[Memcached Monitor Tool]] | ||
+ | * [[Setup Multi Instance Memcache]] | ||
+ | * [[Check if Memcached is Running]] |
Latest revision as of 06:07, 9 November 2013
How to flush your Memcached Instance
If you need to flush your memcached instance because you have made a change to your website
You can running the following command via the command line
echo "flush_all" | nc localhost 11211
or if its setup as a socket
echo "flush_all" | nc -U /path/to/the/socket.sock
You should see the OK once you run the command, meaning your memcached instance has been flushed
If you have to run this command often and you do not want to remember the entire statement, you can always create an alias to run
Example, add the following to your .bashrc file
alias flush_memcached='echo "flush_all" | nc localhost 11211'
Or the following to view your stats
alias stats_memcached='echo "stats" | nc 10.70.30.20 11211'
Then run the following to reload your current .bashrc file
source .bashrc