Sugar Performance
Overview
As your company uses Sugar over time, the size of your database will naturally grow and, without the proper maintenance, performance will inevitably begin to degrade. The purpose of this article is to review some of the most common recommendations for increasing the performance in Sugar to help increase the system's efficiency for your users.
Note: This guide is intended for on-site installations. Customers hosted on Sugar's cloud service should file a support case for any performance issues.
General Settings in Sugar
The following recommendations can be modified in the Sugar admin interface
- Do Not Set Listview and Subpanel Items Per Page to Excessive Settings. Under Admin > System Settings, there are two settings 'Listview items per page' and 'Subpanel items per page'. The defaults for these settings are 20 and 10 respectively. When increasing these values, it should be expected that general system wide performance will be impacted. We generally recommend keeping listview settings to 100 or less and subpanel settings to be set to 10 or less to keep system performance optimal.
- Make sure 'Developer Mode' is disabled under Admin > System Settings. This setting should never be enabled in a production environment as it causes cached files to be rebuilt on every page load.
- Set the 'Log Level' to 'Fatal' and 'Maximum log size' to '10M' under Admin > System Settings. The log level should only be set to more verbose levels when troubleshooting the application as it will cause a performance degradation as user activity increases.
- Ensure the scheduled job, 'Prune Database on the 1st of Month', is set to 'Active'. This will go through your database and delete any records that have been deleted by your users. Sugar only soft deletes records when a user deletes a record and over time, this will cause performance degradation if these records are not removed from the database.
- Make sure 'Tracker Performance' and 'Tracker Queries' are disabled under Admin > Tracker. These settings are intended to help diagnose performance issues and should never be left enabled in a production environment.
- Ensure large scheduler jobs are running at slower intervals under Admin > Scheduler. Jobs such as 'Check Inbound Mailboxes' can decrease overall performance if they are running every minute and polling a lot of data. It is important to set these jobs to every 5 or 10 minutes to help offset the performance impacts for your users.
Sugar Performance Settings
General Settings
Disable client IP verification : Eliminates the system checking to see if the user is accessing Sugar from the IP address of their last page load.
$sugar_config['verify_client_ip'] = false;
BWC Modules
For modules running in Backward Compatibility mode, the following settings can be used to speed up performance:
Drop the absolute totals from listviews : Eliminates performing expensive count queries on the database when populating listviews and subpanels.
$sugar_config['disable_count_query'] = true;
Disable automatic searches on listviews : Forces a user to perform a search when they access a listview rather than loading the results from their last search.
$sugar_config['save_query'] = 'populate_only';
Hide all subpanels : Increases performance by collapsing all subpanels when accessing a detailview every time and not querying for data until a user explicitly expands a subpanel
$sugar_config['hide_subpanels'] = true;
Hide subpanels per session : Increases performance by collapsing all subpanels when accessing a detailview when the user logs in but any subpanels expanded during the user's session will remain expanded until the user logs out
$sugar_config['hide_subpanels_on_login'] = true;
General Environment Checks
Depending on your environment and version of Sugar, there may be additional changes your system administrator can make to improve performance. Please refer to our Sugar On-Site Guide.
PHP Caching
Whether your instance of Sugar is deployed on a Linux or Windows server, you should utilize opcode caching to ensure optimal performance. For Linux servers, APC is the recommended opcode cache for PHP with the following guidelines and settings:
- Use the latest stable version.
apc.shm
size should be close to your program size. For Sugar, that's at least 150 MB (default for apc.shm is 32 MB). When in doubt, more is always better.apc.stat_ctime
should be enabled. This will ensure file changes are noticed. You should note that this may increase thestat()
activity to your NFS.apc.file_update_protection
should be enabled. This helps the system when trying to add multiple files to the cache at the same time.- If your installation of Sugar is located on a network filesystem such as NFS or CIFS, make sure
apc.stat
is enabled. apc.ttl
should be set to 0. This parameter disables garbage collection and can cause fragmentation. Earlier APC releases had locking issues that made caches with many entries take forever to be garbage collected.apc.shm_segments
should be set to the default of 1. If you think you really need multiple shm_segments, you must also read the documentation onapc.mmap_file_mask
as well and understand and set that value accordingly. If you don't understandapc.mmap_file_mask
, you should leaveapc.shm_segments
at the default value.- APC ships with an additional
apc.php
file that when hit with a browser, will show settings, cache information, and fragmentation. If you suspect APC problems, this is a great tool to start checking things out.