For a single-server LAMP site (which is usually under quite high load), what is best way to use memcache?
Does it make sense to run the memcache daemon on the same server as the application, or is that just going to take valuable memory away from MySQL, giving a net performance loss. Does it even make sense to use memcache in this scenario- or is the best solution to always have dedicated servers for memcache?
I appreciate that profiling the site before and after would be required to really answer this question, but I would rather not do that at this stage on the live site. Especially as someone out there certainly knows the answer off the top of their head.
Usually, the recommendation (see What about shared memory? in the memcached page) is to run memcached on the same machines as web servers, on the premise that web applications are CPU-heavy (which memcached is not), whereas memcached is memory-heavy (which most web applications are not, at least in comparison).
So, if your web server has plenty of memory, it's a good idea to run memcached on it. YMMV.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With