What is Memcached?
Short Answer: MemCached makes your PHP-based sites go faster!
Long Answer: MemCached is a generic distributed memory object cache used to enhance the performance of dynamic web applications and sites. It’s open source. It caches chunks of data from the results of database calls, API calls or page load requests into memory.
How does Memcached work?
Let’s back up for a minute here.
What is cache?
A cache is a temporary place where data is stored in memory for faster access. Memory is finite, so everything on a computer cannot be cached. Only frequently-accessed or important objects are therefore cached.
Retrieving data from the database takes server resources and time. Often we need to retrieve the same data over and over again – sometimes in the same session! If it’s possible to fetch the data just once, and use it repeatedly, then it would have saved a significant amount of resource and time.
Enter MemCached. It stores frequently used data in memory. Since data is now loaded from RAM, and not from disk, it’s faster. And since there’s no database call, it’s faster yet again. New database calls are made only when the requested data is not (or not yet!) cached.
Remember that some data is cacheable (frequently needed, important), while some is not (seldom accessed). And the more RAM that is allocated to the cache, the more can be held.
Who MemCached is For
MemCached is ideal for larger database-driven websites or applications with heavy load and frequent database calls. However, it can help even on smaller sites.
And if your app or site is really large, and is powered by a cluster of servers, then it is highly likely that you will benefit from using a distributed cache like MemCached.
Who MemCached is NOT for
If your data is updated frequently (hourly, minutely), then it may lead to low cache hit ratio. There is no point in using MemCached in such a scenario, and you must instead seek other ways to improve site speed.
MemCached does not cache HTML content either. Instead use Varnish or mod_proxy.
MemCached works well – but it’s not for every situation.
Furthermore, MemCached is not intended for caching objects larger than 1 MB in size. So, for example, it will not cache streaming media files.
You also need to analyze the current database load. If you have a powerful SSD-based large-RAM dedicated server or private cloud, capable of handling peak loads, then MemCached may not help much, and you’ll again need to seek other ways to make that data faster.
Do you need a fully-managed service to help you speed up your sites or applications, and think that Memcached may be the solution you’ve been looking for?
Do you want a host with a proven track record that truly understands the finer points of setting up MemCached for optimal speed, and not just a host that will install it with out-of-the-box ineffective settings?
Then let EuroVPS manage the complexity of MemCached, so that you can fully focus on developing your sites or applications.