comet-cache
comet-cache copied to clipboard
Feature Request: Add support for Memcached and Amazon ElastiCache
Instead of storing the cache files on disk, how about an option for storing them in memory?
APC/APCu / Memcached
http://we-love-php.blogspot.com/2013/02/php-caching-shm-apc-memcache-mysql-file-cache.html
+1 for memcache (this would also make QC compatible with ElastiCache from AWS).
Next Actions
- [ ] Create a new abstract class for cache read/write operations; e.g.,
getCache()
,setCache()
,deleteCache()
,purgeCache()
. - [ ] Build a new class that extends the abstraction. One which implements and better organizes the existing cache methodology that ZenCache uses currently. This will become one (of many) caching methods that ZenCache will support moving forward.
- [ ] Build a new class that extends the abstraction. Once which implements an in-memory cache using the
memcached
extension for PHP. http://php.net/manual/en/book.memcached.php - [ ] Adjust the ZenCache source code so that all cache reads/writes/deletes go through a wrapper that will inspect the current configuration of the site; using a particular caching methodology that has been configured.
- [ ] Use this class as an example of how to use a pool of Memcached servers (i.e., one or more) that can live locally or be hosted on another server in a private network.
Memcached and ElastiCache support sounds like a great idea. I'm adding this feature request to my todo list.
I'm also copying the following notes from @JasWSInc that he left on Issue #54 which may be relevant when working on this feature request.
@raamdev I think it would be nice to expose a way for site owners to break out of this
ABSPATH
jail in certain scenarios. In the case reported here, a symlink should do the job. However, if a site owner wanted to use something like Amazon's ElastiCache; a symlink wouldn't be enough. A site owner would need to have the ability to change the root path to what is actually an external server in the case of ElastiCache. http://aws.amazon.com/elasticache/
Other Considerations....
The current benefit of having an
ABSPATH
root hard-coded into the Quick Cache plugin...
- If you import/export your Quick Cache options from one site to another, there is no root path in your options configuration; and thus, it's more portable. i.e. a site owner only configures the local path, and not the full server path.
That's not super important, so perhaps we can improve the flexibility offered by this setting in a future release. Ideally, in a way that would not negatively impact the import/export feature currently offered by QC Pro.
Please don't leave out APC/APCu as an option here. Perhaps a good option would be an abstraction that can talk to a variety of caching systems...
Something like this: http://www.phpfastcache.com/
Or one of these options? http://stackoverflow.com/questions/6100186/looking-for-a-php-caching-library-with-multiple-back-end-storage-adapters
Cachify allows you to cache via "DB, HDD, APC or Memcached": http://wordpress.org/plugins/cachify/
Definitely planning to add support for at least APC and Memcached to Quick Cache.
almost an year, no update for memcache ?
Anyways, +1 for memcache, I 'm looking for a memcache!
Pasting notes here from Jason regarding adding Memcache support to ZenCache Pro:
Integrating a Memcache option should be relatively painless. We have most of the work needed to implement Memcache already in place; i.e. we have all cache purging, clearing, wiping, and directory deletions going through just a couple two or three wrappers.
The next step that I suggest is to create wrappers for all cache writes too. With this in place, we can then take a look at integrating Memcache as an option. The wrappers can be made to detect a Memcache-enabled option, and use Memcache for all cache reads/writes.
Memcache keys can simply follow the existing standard that we use for building a cache path in the file system; only it will be in memory instead of in the local file system.
Referencing: "Difference between Memcache and Memcached": http://stackoverflow.com/questions/1442411/when-should-i-use-memcache-instead-of-memcached
http://php.net/manual/en/book.memcache.php http://php.net/manual/en/book.memcached.php
Referencing Memcache tutorial: https://rtcamp.com/tutorials/php/memcache/
+1111111 (ooops my finger slipped) for Memcached/
Yes this should be something
+1 for Memcached!
YAPO (yet another plus 1) for memcached!
It would be great :) +1 :+1:
So great to see all of these votes for Memcached. I can't wait to see this added to ZenCache; i.e., move away from disk writes and see the speed increase with memory allocation being used instead. On the AWS platform, in particular, this seems to make a lot of sense. cc @raamdev
Adding a list of next actions above ↑
You can force to use memory by mounting the WordPress cache folder to tmpfs. I do this with zencache's cache folder and it is now served by memory. What would memcache bring more to the table? I use memcache for object caching and tmpfs for zencache.
I have memcached installed and running on the server. Currently don't access it yet. With this feature implemented, will transients be able to access the memcached server through Zencache? Or will I need to use a separate plugin like https://wordpress.org/plugins/memcached-is-your-friend/ . Thanks!
@rdanamcd : these are completely different things. Memcached is your friend is there for transients and object cache (I highly recommend activating this: it really is plug and forget). Zencache does not deal with those. Zencache is a page cache engine. Today Zencache uses disk to save the pages (or you can use my workaround as explained above). I suggested it should natively support Memcache for also page caching. Memcache could then manage page expiration and will be a LOT faster than using disk.
I also use Redis as transient / object caching so I would very much appreciate support for Redis as well.
+1 for Memcached/Redis-Support for CometCache!
:+1:
As I wrote back in July I do not understand the purpose of memcache / redis here. You can simply move the whole cache folder to a memory folder and that's all done: no more disk access. See my note from July which then made it to a knowledge base article: You can force to use memory by mounting the WordPress cache folder to tmpfs. I do this with zencache's cache folder and it is now served by memory.
@xberg I quite understand your point, and I could do it myself - but will I make the effort? And what about other people with less skills at the OS level? To get memcached or redis servers running is - on Ubuntu/Debian at least - simply a matter of installing one package, and it runs. Redis is the only system being mentioned here which offers persistence. But it is also not the fastest option, as data is passed via TCP or Unix Sockets. Which for the WP Cache is needless overkill, as it can be rebuilt at the drop of a hat. What I normally do in similar cases is use Nginx + PHP-FPM, and then shared memory via APCu. That way, the shared memory is in the space of the master FPM process and shared with its children, so that's really efficient - low on memory, low on needless repetition, very fast on access. That said, first you need to compile APCu and load it (as a PHP module), so using a temp filesystem in memory is probably not more challenging then getting APCu running, and also not much different in speed.
+1 for Memcached support in the GUI (Redis support would be great too). We generally don't have access to our clients' servers (nor do they), so mounting the cache folder to tmpfs is rarely an option. In instances in which Memcached is available on the server, we generally install W3TC instead of Comet Cache.
In different terms, this is about 10 sales of Comet Cache Pro per day that you -- and we -- are missing out on.
Another +1 for memcache support.
+1 just purchased the Pro Unlimited version. Can't wait for this release for Memcache
Just a quick note here for everyone subscribed to this GitHub issue: The next release of Comet Cache Pro will include support for Memcached / AWS ElastiCache and since we could use all the help we can get testing this new feature we're doing something special this time around and opening the next Comet Cache Pro Beta to everyone, even non-Pro customers.
If you're not a Pro customer and you're interested in helping test this feature, please send an email to [email protected] with the following subject line: "I want to help test Issue #47" I'll send you an email with details as soon as a beta version is available for testing (within the next week or so).
This is fantastic news! I'm a pro user and will report back on this when it's released. I was using tmpfs up until now.
I can't wait to test this out!
Hi, When is this releasing? Many thanks!
Hi, Any info on realease date? thanks
@xberg We're hoping to have a release out within the next week or two. This GitHub issue will be updated once a release occurs.