Using both Opcache and Xcache

I'm just wondering if it is foolish to use Xcache 3 with Zend Opcache at the same time to cache PHP files? I know that both do almost the same job, but are not sure if this will affect performance and speed.

I want to speed up the loading of the php page so that visitors do not have to wait long.

any thoughts on this?

+7
php opcache xcache
source share
1 answer

To answer your question: Yes, you should not run xcache and Zend Opcache at the same time. If you do this, you will get undefined behavior, first of all โ€œcannot update the XYZ classโ€. This happened to me after a system update when a supporting package activated Zend Opcache on an existing xcache installation.

As for the question of how to use it for opcaching, it depends on your specific code - I would recommend setting up a test environment and running Apache Benchmark or a similar tool to check response time.

When installing Wordpress by default, I managed to get acceleration (without cache vs xcache) about 5-7x in size, which is very significant. If you really need more, you will need to check out the other features already mentioned in the comments, for example

  • using loadbalancer and multiple application servers
  • using memcache or memcached to cache database queries and other heavy load operations.
  • Switching to another database system, such as NoSQL (be careful with the consequences)
  • Changing the architecture to a static site using web services that provide interactive content.
+5
source share

All Articles