views:

1494

answers:

4

I use capistrano to deploy my app to a machine that uses memcache. I want capistrano to clear memcache when it deploys a new version of the site.

+2  A: 

Don't know capistrano, but can't you just kill the memcached process and spawn a new one? Better probably for removing fragmentation also.

Toad
capistrano is deployment automation tool, so that restart would also be done by capistrano.
vartec
+4  A: 

Something like that?

vartec
A: 

Just don't. Memcache is not supposed to be restarted. Why would you want to clear your memcache?

If you really want to wipe out your cache at each release, namespace all your keys with your application version.

Yann
+1  A: 

Take a look at this: http://www.strictlyuntyped.com/2008/06/clearing-memcache-without-restart.html

Emerson Macedo
Thanks for the late, but good advice!
MikeN