The aim of this article is to collect performance enhancing tweaks, tips and techniques. Please contribute your own techniques for enhancing performance.
##Lucene Search #Set the following to true if you want to index your entire library of files on startup. index.on.startup=false
General performance #
# The layout cache filter will cache pages to speed up page rendering for # guest users. See ehcache.xml to modify the cache expiration time to live. com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter=true
Disable unneeded filters
## ## Servlet Filters ## .... # # The audit filter populates the AuditRequestThreadLocal with the # appropriate request values to generate audit requests. # com.liferay.portal.servlet.filters.audit.AuditFilter=false and many more
Minimize output #
Compression Filter #
There is a known optimilisation for LR 5.0+ Compression Filter
<filter> <filter-name>Cache Filter - Resource CSS JSP</filter-name> <filter-class>com.liferay.portal.servlet.filters.cache.CacheFilter</filter-class> <init-param> <param-name>url-regex-pattern</param-name> <param-value>.+/(barebone|css|everything)\.jsp</param-value> </init-param> <init-param> <param-name>pattern</param-name> <param-value>2</param-value> </init-param> </filter>
Saves some 50Kb on every page but portlet look-feel modification is not possible for all (including (Omni)Admin)
## Portlet CSS Portlet # Set this to true to enable the ability to modify portlet CSS at runtime # via the Look and Feel icon. Disabling it can speed up performance. portlet.css.enabled=false
# # Set this to false if the system does not use allow users to modify the # look and feel. # look.and.feel.modifiable=true
Not needed scripts could be expunged here. But the fattest of them all jQuery is needed almost always
Setting this will improve download time, but tweaks above are probably unused
## Theme # Set this property to true to load the theme's merged CSS files for faster # loading for production. Set this property to false for easier debugging # for development. You can also disable fast loading by setting the URL # parameter "css_fast_load" to "0". theme.css.fast.load=true
Get your images and other resources from your personalised theme or even an HTTP server alias like www.liferay.org/resources/ Resources uploaded in Liferay are being served-up from database and will always be slower than using this strategy. especialy for recurring enterprise logo's and all.
If you need a high performing landing-page and other pages you could consider creating a special theme for these pages.
Velocity Caching #
# Set this to true in production so that VM templates are cached velocity.engine.resource.manager.cache.enabled=true
Hack removing ALL CSS
#if ( $is_signed_in ) #css ($css_main_file) #end
Hack removing ALL scripts en catching script exceptions LR 4.3.4
<head> <title>$company_name - $the_title</title>
#if ( $is_signed_in && ($permissionChecker.isOmniadmin() ) ) #js ($js_main_file) #end </head>
only use $is_signed_in for all signed in users/admin's
##These settings have been found to increase database connection performance jdbc.default.idleConnectionTestPeriod=0 jdbc.default.preferredTestQuery=SELECT releaseId FROM Release_ ##The Tomcat Thread pool has been found to be faster than 3CP0 or DBCP jdbc.default.liferay.pool.provider=tomcat
Links to useful references:
- A good sample my.cnf: http://www.theadminzone.com/forums/showthread.php?t=8150
- Optmization, understanding mysql: http://www.mysqlperformanceblog.com/files/presentations/UC2005-Advanced-MySQL-Performance-Optimization.pdf
- MySQL Performance Tuning Primer Script: http://day32.com/MySQL/
General SQL: clustering databases
Sequoia is a transparent middleware solution offering clustering, load balancing and failover services for any database. Sequoia is the continuation of the C-JDBC project. The database is distributed and replicated among several nodes and Sequoia balances the queries among these nodes. Sequoia handles node and network failures with transparent failover. It also provides support for hot recovery, online maintenance operations and online upgrades.
If you're serving content using SSL, open the URL
Locate the value:
Double-click to set value to true
Without this setting, each and every page load will reload all the images and CSS, making pages load about 5 times slower.
Application Server #
Enable Servlet Caching & Dynamic Caching.
Optional: Create a cachespec.xml to cache dynamic content:
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tdyn_dynamiccacheconfig.html (Without a cachespec.xml only static content is cached, but are there any dynamic jsps with a constant static output?)
But be careful, these settings need a powerful Application Server.
Improvement: Approxamately 50% faster
Probably this works also with other Application Servers like Tomcat...