Increasing PHP Performance with APCu and OPcache

The performance of Kolab Groupware web interfaces can be increased significantly by using the Alternative PHP Cache (APC user cache) and OPcache.

This article outlines the installation and configuration of both caches.

APC user cache is the Alternative PHP Cache stripped of opcode caching, which is now available as the opcache extension to PHP.

CentOS 7 and Red Hat Enterprise Linux 7 (Maipo)

The software packages are available from the EPEL repository, and are installed as follows;

# yum -y install php-pecl-apcu php-pecl-zendopcache

Configure APCu to allow for upload progress reporting by editing /etc/php.d/apcu.ini and ensuring the following settings are included;

apc.rfc1867=1
apc.rfc1867_prefix =upload_
apc.rfc1867_name=APC_UPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600

Separately configuring OPcache is not required.

Restart the httpd service for the new extensions to be loaded;

# systemctl restart httpd
Posted in Guides and tagged , , , , , , , , , , , , .