PHP Caches and Accelerators

From SugarCRM Wiki

Jump to: navigation, search

PHP accelerators are a great way to get more performance out of your hardware. There are several major components to PHP accelerators. All of them support caching of the parsed PHP files. Sugar uses over 100 files per round trip, so loading parsed files provides a huge performance advantage. Most of them also have some level of external data caching (Sugar has an API to leverage them) and File Transfer Services (Sugar does not leverage this out of the box).

They come in a wide variety of flavors...Here are the top four that Sugar is tracking:

Contents

APC

  • External Cache API integrated from 4.5.0e on.
  • Very fast op-code cache
  • Open Source and Part of Pear/PECL http://pecl.php.net/apc
  • Sample configuration overview: http://devzone.zend.com/manual/view/page/ref.apc.html
  • Please note: Sugar uses a lot of source files. The standard 30 MB memory size is too low for running Sugar. Add these lines at the end of php.ini:
    • apc.shm_size = 64
    • apc.shm_segments = 2

Zend Platform

Memcache

eAccelerator

  • op-code cache
  • not yet supported as an external cache in Sugar.
  • Some issues with PHP 5. Cache support is not working well. Acceleration is good.
  • Php-eaccelerator on Fedora Core 5, Php 5.1.4, Apache 2.2.2, breaks the Email and EmailTemplate EditViews. (this is a FC5 specific problem). -- thanks to David O'Keefe
  • Open Source http://eaccelerator.net/

Zend Optimizer

Disabling External Cache (SugarCRM 5.1.0a +)

Sugar automatically enables external cache support once it detects a supported external cache method. The order of this detection is Zend, Memcache, APC. If you have multiple caches enabled it will utilize the first one detected. If you wish for it to use a different cache you may set the following config settings to disable an external cache.

$GLOBALS['sugar_config']['external_cache_disabled_apc'] = true; //if set to true will disable apc external cache.

$GLOBALS['sugar_config']['external_cache_disabled_memcache'] = true; //if set to true will disable memcache external cache

$GLOBALS['sugar_config']['external_cache_disabled_zend'] =true; //if set to true will disable zend external cache

$GLOBALS['sugar_config']['external_cache_disabled'] = true; //will disable all external caching.

Untested

XCache

See Also

Personal tools