When porting ZurmoCRM onto NAS, I saw many of them provide SugarCRM. You may found it in TurnKey Linux SugarCRM which is easier to setup.
I list a series of questions related to SugarCRM and take my notes here.
What PHP Accelerators does SugarCRM support?
Many. In [your web server root directory]/sugar/include/SugarCache/SugarCache.php, the cleanOpcodes() function lists supported opcode cache:
If your hosting service doesn’t provide any of above, you may follow XCache and SugarCRM – Any Advice, about to try it out to modify source code to enable support. Here is the key from Jacob.
It all starts in:
/include/utils/external_cache/SugarCache.phpYou need to add extra code to handle the cache in the “discover” function.
You then need to add a file that is similar to “SugarCache_APC.php” but has your name instead of APC and all of the appropriate function calls. There are only 67 lines in the APC implementation and two primary functions.
Specific the PHP Accelerators
For LAMP with more than one PHP Accelerators, you might want to disable others preventing SugarCRM to use them.
Modify config_override.php and use following configuration to disable those you don’t need.
$sugar_config['external_cache_disabled'] = true; // Disables all external caching $sugar_config['external_cache_disabled_apc'] = true; // Disables APC $sugar_config['external_cache_disabled_memcache'] = true; // Disables Memcache $sugar_config['external_cache_disabled_memcached'] = true; // Disables Memcached $sugar_config['external_cache_disabled_redis'] = true; // Disables Redis $sugar_config['external_cache_disabled_smash'] = true; // Disables sMash $sugar_config['external_cache_disabled_wincache'] = true; // Disables Wincache $sugar_config['external_cache_disabled_zend'] = true; // Disables Zend
The cache manager is in [installed folder]/include/SugarCache/SugarCache.php
More detail may be found in PHP Caching.
Increase PHP Accelerators Cache Size
It is recommend to use APC with SugarCRM. Increase apc.shm_size in apc.ini to 64M with 1GB and 128M with 2GB installed. If you are using QTS from QNAP, you need to manually look for eaccelerator.shm_size in Qthttpd.sh and increase the number. Detail directory can be found in QNAP QTS Configuration and Executable Files.
You may use PHP Accelerators with memcached together for different purpose according to Speeding up Sugar using an external cache.
Enable Support for memcached
You will need enable Memcache or Memcached in PHP to communicate with memcached. Use <?php phpinfo(); ?> to check if one of them is loaded.
To enable in your Linux or NAS, check the following posts:
- Optimize TurnKey Linux for ZurmoCRM
- Optimize Asustor ADM for ZurmoCRM
- Optimize QNAP QTS for ZurmoCRM
Although QNAP supports memcached, you need to compile your own Memcache or Memcached according to Optimize Synology DSM for ZurmoCRM.
Please add memcached information to config.php with following configurations:
$GLOBALS['sugar_config']['external_cache']['memcache']['host'] = '<<memcached server IP>>'; $GLOBALS['sugar_config']['external_cache']['memcache']['port'] = '<<memcached port number>>';
More detail may be found in Speeding up Sugar using an external cache.
Increase memory_limit with Care
It is reported that PHP segmentation fault when using more than 128M. Jason thinks it might be related to file issue and PHP fail to kill the process when memory_limit is more than 128M.
If you encounter segmentation fault, try to decrease your memory_limit to 128M.
Notes
- Size for apc.shm_size and memcached may vary depends on systems environments and usage scenario.
- If you are looking for files, for Linux distributions, you may found them in TurnKey Linux Configuration and Executable Files and OpenSuSE Configuration and Executable Files. For NAS, Asustor ADM Configuration and Executable Files, QNAP QTS Configuration and Executable Files, Synology DSM Configuration and Executable Files may help.
- You may fine-tune on apache and MySQL in SugarForge.org: How to enhance SugarCRM Performance? (v1.0) and SiteGround: Knowledge Base: How to optimize SugarCRM for better performance?
Reference
- ZurmoCRM
- SugarCRM
- TurnKey Linux SugarCRM
- Test your ZurmoCRM with VirtualBox
- Wiki: List of PHP accelerators
- PHP: Alternative PHP Cache
- eAccelerator
- ionCube PHP Accelerator
- Microsoft: WinCache Extension for PHP
- XCache
- Wiki: LAMP (software bundle)
- SugarCRM: Guides: PHP Caching
- SugarCRM Developer Blog: Speeding up Sugar using an external cache
- PHP: PHP Manual: Function Reference: Affecting PHP’s Behavior: APC: Installing/Configuring: Runtime Configuration
- PHP: PHP Manual: Function Reference: Affecting PHP’s Behavior: APC: Installing/Configuring: Runtime Configuration: apc.shm_size
- GitHub: eaccelerator: Wiki: Settings: eaccelerator.shm_size
- QNAP
- QNAP: QTS
- QNAP QTS Configuration and Executable Files
- PHP: PHP Manual: Function Reference: Other Services: Memcache
- PHP: PHP Manual: Function Reference: Other Services: Memcached
- memcached
- Optimize TurnKey Linux for ZurmoCRM
- Optimize Asustor ADM for ZurmoCRM
- Optimize QNAP QTS for ZurmoCRM
- Optimize Synology DSM for ZurmoCRM
- ServerFault: PHP segmentation fault when using more than 128M
- ServerFault: Jason
- PHP
- PHP: PHP Manual: Appendices: php.ini directives: memory_limit
- TurnKey Linux Configuration and Executable Files
- OpenSuSE Configuration and Executable Files
- Asustor ADM Configuration and Executable Files
- QNAP QTS Configuration and Executable Files
- Synology DSM Configuration and Executable Files
- apache
- MySQL
- SugarCRM: Forum: XCache and SugarCRM – Any Advice, about to try it out
- SugarForge.org: How to enhance SugarCRM Performance? (v1.0)
- SiteGround: Knowledge Base: How to optimize SugarCRM for better performance?