I think a major drawback of Sugar is that is feels quite slow.
A number of things together account for the feeled slowness of Sugar.
These are:
- the time spend on database queries
- php execution time
- template engine
- webpages transmission time to the browser
- icon/css/js/images verification and or transmission times
- rendering time in the browser
For us users its difficult to change the source code of Sugar to run faster.
But luckily, there are a number of ways for us to tune a Sugar installation to increase the speed.
With some server tuning its quite simple to double or triple the speed of Sugar.
2) - the time spend on database queries
The MySQL server has a feature called "Query Cache".
This cache remembers the answer to recently issued queries.
Sugar repeats a lot of queries from page to page.
Activating the query cache in MySQL will significantly improve the database speed.
To activate the query cache set the query_cache_size parameter in the my.cnf config file of MySQL.
E.G. query_cache_size = 32777216
The above line will set the cache size to 32 MB
2) PHP execution time
Sugars source files are big. The PHP compile and execution times are quite high.
Make sure that you install a PHP code cache like eaccelerator or apc to cut down the PHP JIT compile times to zero. Using such a PHP code cache has no drawbacks and will increase the speed of Sugar a lot.
3) Webpages transmission time to the browser
Sugar webpages are quite big, typical size is 100-200 KB per page.
In addition to the dynamic created html pages, there many JS or CSS files which are quite huge. All the files inlcuded in the login page alone are over 500 KB altogether. Downloading this much data simply takes some time. To speed up the download times, activate HTTP content compression in your webserver. When you use Apache this can be done by mod_gzip (or mod_deflate for Apache2).
Content compression will reduce the amount of transfered data by 80%
Compressing of the files will need a little bit CPU resources but this is neglectable.
The heavely reduced time for the download is worth it. You will feel this speed up.
Normally a website might not want to compress JS files to be compatible with some very old webbrowsers (old Netscape version could not handle compressed JS files).
You should enable compression of JS files for Sugar. Sugar does not work with old Netscape versions in the first place - so there is no drawback. And Sugar has many big JS files which will download MUCH faster when compressed.
Example mod_gzip :
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.js$
mod_gzip_item_include file \.css$
4) icon/css/js/images verification and or transmission times
Sugar themes look nice and contain many small image files.
A typical single Sugar page contains about 40 images and numerous JS and CSS files.
A webbrowser will cache these files, so it will effectively only download them once.
But typically (depending of your cache settings) a webbrowser will verify with every opened Sugar page that the cached image and JS files are still the newest version. This means typically a webbrowser will unneccessarily open 40-50 connnections to the web server per opened Sugar page to verify the cached images.
This wastes a lot of time and puts unneeded load on the webserver.
By hinting the webbrowser that it is allowed to cache the files without constant verifycation, this time can be saved. To enable this hinting, activate mod_expire in Apache.
Adding these lines to your Apache conf will remove the unneeded verifications and feelable speedup sugar:
ExpiresActive On
ExpiresByType image/gif "access plus 3 days"
ExpiresByType image/jpeg "access plus 3 days"
ExpiresByType image/png "access plus 3 days"
ExpiresByType application/x-javascript "access plus 3 days"
ExpiresByType text/css "access plus 3 days"
5) Rendering time in the browser
While compressing the Sugar html pages is a first step to speed up the download of the sugar pages - an advanced alternative is to not send already downloaded pages at all.
This is possible and will reduce the download times to zero, for pages that the users has visited before and which did not change. This will speed up Sugar a lot.
A way how to enable this (including needed source code ) is explained in Sugar bug report 9136
http://www.sugarcrm.com/crm/?option=...1-4511070396fa
I hope that the Sugar team will include this into SugarCRM to speed it up.
I hope that the above is helpfull for some of you.
If you have other tips to speed up Sugar please include them.
Cheers
Gunnar von Boehn
www.mycrmspace.de


5Likes
LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks