Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

So I have been using memcached with a new django app and it works great, I can serve the dynamic version of the site slighly faster than if I mirror the files to a static sever. I have this setup on a vps and started memcached with the 'memcached -d -u www-data -p 11211 -m 64' like I was told in a tutorial. I would now like to increase the memory allocation and allow my cpanel vps to access my memcached instance on my django vps, to speed up some joomla sites. How do I configure memcached to allow the other VPS to access it? I don't want to screw around with trying to install it on my cPanel VPS, as it's live and I would have real headaches if something didn't go right (plus I went with a cheap license and the company won't support me, they told me to ask cPanel and cPanel told me to ask my licenser :( ), Plus I'm already running into mysql connection troubles.

I have already tried, and I definatly can't access it from any other machine other than the vps it's running on.

Thanks!

share|improve this question

1 Answer 1

From the memcached manpage:

   -l <ip_addr>
          Listen on <ip_addr>; default to INADDR_ANY. This is an important
          option  to  consider  as  there  is  no  other way to secure the
          installation. Binding  to  an  internal  or  firewalled  network
          interface is suggested.

Basically (as with other daemons) make sure it listens on an IP reachable by all things that want to use it.

Be aware memcached has no security builting so a rogue site might connect just

echo "flush_all" | /bin/netcat -q 2 memcached-instance.example.com 11211

And your cache is gone. I strongly recommend against a single memcached instance between all your clients. Not only one could flush all the caches but there's nothing that'll keep one site from overwriting anothers key. Which (to me) is even worse. Caches that give you the wrong data will be a lot worse than caches that will have no data.

  • Firewall your memached
  • Use one memcache cluster per client (a cluster of 1 also a cluster :)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.