Php – Does APC really improve performance with PHP 5.3+

performancePHP

According to a Linux Adminstrator over at Hostgator:

With PHP 5.3 having APC installed is not needed as PHP 5.3 already has
improvements that APC does resolve in it.

Is that statement actually accurate? Does installing APC (Alternative PHP Cache) give any performance improvements with PHP 5.3?

I questioned this statement and a different admin defended it by:

the official word we have from our upper tier administrators is to
avoid APC as PHP 5.3+ has improved from previous versions such that
APC can potentially become redundant or even conflicting

Am I being tossed around here or is this statement valid? This issue was discussed with Hostgator in regards to installing APC on their Level 7 VPS.

Best Answer

The purpose of APC is to provide:

  • opcode cache (in a nutshell - saving compiled PHP code to memory for reuse/performance)
  • data store (providing API for PHP code to persistently store and retrieve data to/from memory)

PHP 5.3 release, while being important release in general, has no such functionality natively.

Upcoming PHP 5.5 is planned to integrate Zend Optimizer for opcode cache (but no data store).

There might be configuration, security, resource consumption and other considerations to advise against APC in specific cases.

However implying that PHP 5.3 somehow has replacement functionality and has no need for opcode caching (APC or other) is blatantly incorrect.

So the very first thing you should do, if you haven't already, is to install opcode cache.

Rasmus Lerdorf (creator of PHP)

Digg Technical Talks - PHP Performance 00:17:21

Related Topic