I would like to use PHP 7. However there seems to be no option for key-value memory caching.
APC is discontinued.
XCache will not be available for PHP 7 for some time.
Is there an available alternative for PHP 7?
Or is there a way to use PHP7's Opcache to implement key-value memory caching?
Redis uses a single core and shows better performance than Memcached in storing small datasets when measured in terms of cores. Memcached implements a multi-threaded architecture by utilizing multiple cores. Therefore, for storing larger datasets, Memcached can perform better than Redis.
APC User Cache (APCu) Alternative PHP Cache (APC) is a free and an open source PHP accelerator. Like Zend OPcache, it's mainly designed to cache the PHP opcode output in the server's shared memory.
Memcached is an object caching system. It is primarily used to cache the results of database queries, helping dynamic websites like WordPress® and Drupal to serve pages faster. It can also significantly decrease resource use on a busy web server by reducing calls to the database.
I'd suggest using Memcached, especially if you're concerned about performance.
Whilst you are correct that APC(u) is a lot faster than Memcache, you're not taking into the account that by the time you're worrying about these metrics, you will be running across multiple servers and APC(u) cannot be shared across nodes.
You can use a single Memcache instance or cluster to serve as many application servers as you want. Scalability is a greater concern in modern application development than "how much performance can I squeeze out of one server?"
Having said that, your alternative is APCu, which has all of the functionality that you're used to from APC. It is marked as stable with PHP7 but I wouldn't recommend this because of its single-node nature & inability to work correctly with fastcgi.
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