`

Liferay性能调优

阅读更多
CONTRIBUTIONS WANTED Corné|Corné 03:14, 19 November 2007 (PST)

The aim of this article is to collect performance enhancing tweaks,tips and techniques.

Startup
##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
System.properties;

# 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
Minimize output

HTML
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
JAVASCRIPT
Not needed scripts could be expunged here. But the fattest of them all jQuery is needed almost always

## JavaScript
# Set a list of JavaScript files that will be loaded programmatically in
# /html/common/themes/top_js.jsp.
#
# The ordering of the JavaScript files is important. Specifically, all
# JQuery scripts should go first.
#
# The Liferay scripts are grouped in such a way, that the first grouping
# denotes utility scripts that are used by the second and third groups. The
# second grouping denotes utility classes that rely on the first group, but
# does not rely on the second or third group. The third grouping denotes
# modules that rely on the first and second group.
#
javascript.files= .....

Setting this will improve download time, but tweaks above are probably unused

## JavaScript
# Set this property to true to load the combined JavaScript files from the
# property "javascript.files" into one compacted file 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 "js_fast_load" to "0".
javascript.fast.load=true
CSS
## 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

RESOURCES
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.
THEMES
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

CSS
Hack removing ALL CSS

edit templates\portal_normal.vm;

<head>
#if ( $is_signed_in )
  #css ($css_main_file) 
#end
</head>
JAVASCRIPT
Hack removing ALL scripts en catching script exceptions LR 4.3.4

edit templates\portal_normal.vm;

<head>
  <title>$company_name - $the_title</title>
#if ( $is_signed_in && ($permissionChecker.isOmniadmin() )  )
   $theme.include($top_head_include)
#else
  <script type="text/javascript">
    // hack catching exceptions
    Liferay = function() {return {};}();
    Liferay.Portlet = {
     isAjax: function(id) {return true;},
     process: function(id) {}
    };
    Liferay.Session = {init: function(params) {}};
  </script>
#end
#css ($css_main_file) 
#if ( $is_signed_in && ($permissionChecker.isOmniadmin() )  )
   #js ($js_main_file)
  #end
</head>
only use $is_signed_in for all signed in users/admin's

$is_signed_in
Database
MySQL:
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

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.

http://sequoia.continuent.org/HomePage


Browser
Firefox

If you're serving content using SSL, open the URL

   about:config
Locate the value:

   browser.cache.disk_cache_ssl
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
WebSphere:

   Enable Servlet Caching & Dynamic Caching.
Dynamic Caching:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tdyn_enablecache.html

Servlet Caching:

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1''index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/tdyn_servletcaching.html''

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...

Related Articles
Checklist for Getting Your Website Ready for Production
分享到:
评论

相关推荐

    liferay性能调优文档

    以下是对标题"liferay性能调优文档"中涉及的知识点的详细阐述: 1. **资源优化**:Liferay性能调优的第一步是优化资源使用,包括内存分配、数据库连接池设置以及磁盘I/O。确保服务器有足够的内存用于运行Liferay,...

    [Liferay] Liferay Portal 性能调优最佳实践 (英文版)

    [Packt Publishing] Liferay Portal 性能调优最佳实践 (英文版) [Packt Publishing] Liferay Portal Performance Best Practices (E-Book) ☆ 出版信息:☆ [作者信息] Samir Bhatt [出版机构] Packt Publishing...

    liferay经典书籍8本

    性能调优是任何系统都必须面对的问题。本书针对Liferay,讲解了数据库优化、内存管理、缓存策略以及监控工具的使用,帮助读者提升Liferay的运行效率和响应速度。 以上书籍覆盖了Liferay开发、管理和优化的多个方面...

    liferay development 中文

    这涉及到缓存策略、数据库查询优化、页面加载速度提升等方面,开发者需要熟悉Liferay的性能调优工具和最佳实践。 通过深入学习以上知识点,并结合《Liferay Custom Development 中文》提供的指导,开发者能够熟练地...

    Liferay合集.zip

    8. **性能优化**:学习如何调整Liferay的配置以提高系统性能,包括缓存策略、数据库调优等。 9. **API与插件开发**:熟悉Liferay的JavaScript API,以及如何开发和部署插件。 10. **集成与互操作性**:了解Liferay...

    Liferay开发指南(中文)和liferay详细介绍(英文)

    8. **性能优化**:获取关于提高Liferay性能的技巧,包括缓存策略、数据库调优和服务器配置。 在"liferay详细介绍(英文)"中,可能涵盖更深入的技术细节,例如: 1. **模块化开发**:Liferay 7及更高版本引入了...

    liferay in action.pdf

    - **优化性能**:提供性能调优技巧,确保应用程序高效运行。 **5. 使用主题和布局模板设计您的网站** - **主题设计**:介绍如何设计美观且符合品牌风格的主题。 - **布局管理**:教授如何管理页面布局,实现响应式...

    liferay相关文档

    Liferay是一款开源的企业级门户平台,它...以上只是Liferay部分核心知识点的概述,实际使用中,还需要深入学习其配置、安全、性能调优等方面的知识。如果你对这些内容感兴趣,这个压缩包中的文档将是你宝贵的参考资料。

    liferay-development-zh.rar_liferay

    这包括数据库查询优化、缓存策略配置、portlet性能调优等方面。 10. **部署与测试**:了解如何在不同环境中部署Liferay,如本地开发环境、测试服务器和生产环境,以及如何进行单元测试和集成测试,都是开发过程中的...

    liferay 开发资料大全

    通过阅读和理解Liferay的关键代码,开发者可以更深入地理解Liferay的运行机制,从而更好地进行性能调优和问题排查。 最后,《liferay架构》部分将详细阐述Liferay的整体架构,包括其模块化设计、服务层、持久层以及...

    liferayTuning2

    【标题】"liferayTuning2" 涉及的主题是Liferay门户平台的性能调优,这是一项关键任务,确保Liferay运行高效且稳定。Liferay是一个开源的企业级门户平台,广泛用于构建企业网站、社交网络和协作平台。调优涉及到多个...

    seo-with-liferay-final-140925101855-phpapp01_liferay_

    5. **性能优化**:讨论速度优化的重要性,包括图片压缩、CSS和JavaScript的优化,以及如何通过Liferay的性能调优来提高加载速度。 6. **移动友好性**:强调移动设备的SEO策略,如响应式设计和移动特定的优化设置,...

    Liferay Portal performance

    本次研究由 Liferay 工程团队执行,旨在通过一系列用例(包括基础设施门户、协作和内容管理)进行密集调优和测试,以展示 Liferay Portal EE 的可扩展性。 该研究的目标是: - 确定单个物理服务器在定义的测试案例...

    liferay开发手册

    7. **性能优化**:如何通过缓存策略、数据库调优和集群设置来提升Liferay的性能。 8. **国际化和本地化**:Liferay支持多语言环境,开发者需要了解如何为Portlet添加多语言支持。 9. **部署和测试**:包括如何打包...

    Liferay+Portal+5[1].2+Systems+Development.pdf

    8. **性能优化与监控**:提供性能调优的建议和工具,以及如何监控Liferay Portal的运行状态。 9. **升级与维护**:指导如何从旧版本升级到5.1.2,以及日常的维护和故障排查技巧。 10. **社区与资源**:介绍Liferay...

    Liferay管理员手册

    此外,还可能包括对性能调优和监控的建议,以确保系统稳定运行并适应企业规模的增长。 这份管理员手册应提供详尽的说明和最佳实践,帮助管理员更好地部署、配置和维护Liferay系统。通过跟随手册的指导,管理员可以...

    liferay-tech

    为了确保Liferay在高流量环境下稳定运行,文档将提供性能调优策略。这包括数据库优化、缓存策略、服务器配置调整以及JVM参数设定。同时,也会介绍监控工具和日志分析,以便于诊断和解决问题。 八、Liferay集成与...

    Liferay门户手册.pdf

    系统调优是为了提升Liferay门户的性能,可能涉及到优化数据库查询、调整缓存策略、优化代码等。而系统备份则是为了防止数据丢失,定期备份数据库和关键文件是非常重要的。 #### 结论 Liferay门户的部署和维护是一...

    (英文版)liferay portal 6 企业网络版(Liferay Portal 6 Enterprise Intranets.pdf)

    6. **性能优化与扩展**:Liferay支持高度的定制化和扩展性,书中提供了性能调优的最佳实践,以及如何利用插件和API开发自定义功能,满足企业特定需求。 此外,本书还涉及了Liferay与其他企业系统(如CRM、ERP)的...

    LiferayinAction电子书完整版

    9. **性能优化**:提供性能调优的技巧和最佳实践,包括数据库配置、缓存策略和服务器调整。 10. **社区与生态**:介绍Liferay的社区支持,如论坛、文档和开源项目,以及如何参与和贡献社区。 通过阅读《Liferay in...

Global site tag (gtag.js) - Google Analytics