Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • IBM Web Experience Factory wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.1
  • 6.1.2
  • 6.1.5
  • 6.1.5.1
  • 7.0
  • Ajax
  • Alerts
  • Annotations
  • attachment
  • best practices
  • BlackBerry
  • builder
  • builder faq
  • builders
  • charts
  • Code samples
  • Connections
  • css
  • Custom builder
  • CustomBuilder
  • dashboard
  • Data Access
  • data access faq
  • Data and variables
  • Database
  • Databases
  • Debugging
  • demo
  • demo models
  • demo projects
  • demo widget
  • demos
  • deployment
  • deployment faq
  • Deployment scenarios
  • development
  • dojo
  • Domino
  • faq
  • fixpack
  • General FAQ
  • getting started
  • Help
  • HTML
  • html templates
  • ILOG
  • integration
  • iPhone
  • JViews
  • Learning
  • Logging
  • lotus connections
  • Lotus Widget Factory
  • media dashboard
  • media pf
  • media widget
  • mobile
  • mobile smartphone development
  • Model development
  • new
  • Notifications
  • overview
  • page automation
  • Portal
  • Portal Integration
  • portal integration faq
  • Portlet
  • Portlet Factory 7
  • presentation
  • presentation faq
  • Profiling
  • Quickr
  • REST
  • rest faq
  • REST Service Call
  • restructure handler
  • rich ui
  • sample
  • sample application
  • samples
  • schema
  • Security
  • Smartphones
  • SOA
  • social
  • Source Control
  • sql
  • summary and drilldown
  • Team development
  • Troubleshooting
  • ui
  • User Interface
  • video
  • web 2.0
  • Web Experience Factory
  • Web Experience Factory 8
  • Web Services
  • websphere dashboard framework
  • wef
  • wpf
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > Best Practices > Performance Best Practices
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Performance Best Practices 

expanded Abstract
collapsed Abstract
No abstract provided.
ShowTable of Contents
HideTable of Contents
  • 1 Overview
    • 1.1 Avoid retrieving large data sets and large session variables
    • 1.2 Transform results in stateless service providers not in service consumers
    • 1.3 Use caching across users when feasible
    • 1.4 Avoid deploying a large number of WebSphere Portlet Factory WAR files
    • 1.5 Restart Performance Test and Production Servers after redeploying WARs
    • 1.6 Use the latest version and fixpack of WebSphere Portlet Factory
    • 1.7 Use WebSphere Portlet Factory built in logging and diagnostic tools to look at performance related information
    • 1.8 Use automated load testing tools to validate the performance and capacity of your application
    • 1.9 See the WebSphere Portal and WebSphere Application Server tuning guides for recommendations to optimize server performance
    • 1.10 Be aware of the impact of WebSphere Portlet Factory profiling features
    • 1.11 When using profiling for Personalize support in WebSphere Portal consider using the Execution Time setting for profile entries
    • 1.12 Utilize the capabilities of external systems when possible
    • 1.13 Disable testing support in service provider models
    • 1.14 Avoid excessive logging and related String construction
    • 1.15 Client (Browser) side performance concerns

Overview


This page collects some best practices for Portlet Factory related to performance and memory. This is not a comprehensive list, and most of the best practices for the underlying platforms – WebSphere Portal, J2EE and WebSphere Application Server, and Java - are also applicable for Portlet Factory applications.

Avoid retrieving large data sets and large session variables



Large data sets are the most common cause of memory capacity issues. Here are some suggestions for how to keep data sets smaller.

- When retrieving data, try to retrieve a small amount for viewing at a time. Depending on your data source, you can often reduce size with a more restricted query (to reduce the number of rows and/or number of columns retrieved). With SQL builders, you can use a selective query to do this. With Domino, you might consider using or creating more selective views in Domino, to reduce the row and column count.
If you can't restrict the data set size from the data source (for example, if you only need to display a few columns while your data source returns a lot of columns), you can create a service provider that removes unneeded data, so that the data used by your consumer model (and potentially stored in session) is smaller.

- If you have a large set of categorized data, consider providing an interface that initially shows just a list of the categories, with links to retrieve data for a single category at a time. This technique uses much less memory than retrieving the entire data set and displaying it with Category Row builder, for ex ample.

- Caching of results can be another technique for sharing data across users and reducing session memory use. For example, if you enable caching in the Service Operation builder, all users (for the same profile) will share the same result object. This sharing will occur even though the result variable may be session-scoped in the consumer model - each user session will have a reference to the same Java object.

- Use paging to fetch data in subsets. There are a number of builders in Portlet Factory that support a UI for paging through tabular data sets. For example, there are paging options in the View & Form builder and the Data Page builder, and the Paging Assistant builder provides some of the underlying support. These paging features can use a "DataRetriever" interface that can be used to automatically fetch data in chunks from an external source. Some data access builders such as SQL Call and Domino Data Access can provide support for a paging DataRetriever interface. Other data access builders such as SAP Function Call do not have any built-in support for paged data access. There are two samples that show some custom support for paging data: IBM - Paged web service provider and IBM - Creating a custom data paging provider. When you are using Data Page builder to display paged data, be sure to select the top-level variable as the data to display, not an XML element within the variable.

- For large variables, if they can be marked as "Shared (read-only)", they will share a copy instead of having a copy in each session. Some builders such as Localized Resource will create read-only variables. Similarly, Variables that are marked as request scoped will not be stored in the session.

- In Portlet Factory 6.1, you can use the Discardable Variable builder to convert a variable to request scope, with support for reloading data if needed and for caching in WebSphere DynaCache.

Note that in Portal, each portlet gets its own session, and once a portlet session is created, it is not released until the entire Portal session is released. This means that if you have a large number of portlets spread across many Portal pages, they can potentially all end up in session. Therefore when you have a large number of portlets, it's especially critical to keep Variables in session as small as possible.

Transform results in stateless service providers not in service consumers


Many use case scenarios call for creating simpler UI-oriented schema defined structures and transforming larger complex result sets from back end integration calls into these smaller structures. When calling these back end data integration operations via stateless service provider, it is significantly more efficient to transform the results into the new variable structure in the stateless service provider than it would be to do so in the consumer. By not exposing the larger result set outside of the stateless provider, you end up only storing the smaller transformed variable in the user's session in the consumer. If you instead return the entire result set to the consumer and transform it there, you would be storing both the original larger results that you no longer need and the transformed results in each user's session, thus using a lot more memory under a heavy user load on the system.

Use caching across users when feasible


The Cache Control builder lets you cache the results of an operation across users. The results are shared for all users of the same model and profile, so this m echanism is not suitable for user-specific queries or results.
The Service Operation and Lookup Table builders also have options for caching results, and both use the functionality of the Cache Control builder under the covers.
Note that when you are using the Cache Control builder, you have to select a method that returns the data to cache, and that method should not have any important side effects.
If you cache a method or service operation that takes input arguments, the Cache Control builder will automatically keep a separate cache entry for each unique set of input values. Therefore you should use it cautiously for methods that take arguments, since you could potentially end up with a large number of cache entries.
The data cached with these builders is associated with a specific generated WebApp. In other words, each profile will in general have its own cache. This is necessary in some cases. However, if you have a scenario where data can be cached across profiles, it may be best to implement the caching in a non-profiled model (perhaps a service provider model), so that the cached data can be shared across all users.

Avoid deploying a large number of WebSphere Portlet Factory WAR files


Instead, combine portlets in a small number of WAR files (ideally, one or two). You can have as many portlets as you want in a single WAR file. Each WAR has overhead of 8MB or more, so if you deploy 20 WARs, you could use perhaps 150MB - 200MB extra memory, when compared with using a single WAR. Also, keep in mind that Portlet Factory caching cannot be shared across WARs. For example, if you have a service provider with a cached operation returning several MB of data, each WAR will have its own copy of that data.

Restart Performance Test and Production Servers after redeploying WARs


When you redeploy a WAR, the server stops the application, replaces the deployed WAR with the new one, and thus when it starts up you have a NEW copy of all the WAR's necessary classes loaded into memory. JVMs don't immediately garbage collect "classes" (as opposed to object instances), and some classes may have static references to the old (pre-redeployment) caches, which can then keep references to old cache data object instances in memory. To avoid unnecessary memory use by those old classes, it is a best practice to restart performance test servers and production servers after redeploying your portlet WARs, to immediately remove any old classes from memory.

Use the latest version and fixpack of WebSphere Portlet Factory


Each Portlet Factory release typically includes additional performance and memory optimization work. By using the latest release you can get the benefit of all Portlet Factory product improvements related to performance. Check to make sure you have the latest fixpack also.

Use WebSphere Portlet Factory built in logging and diagnostic tools to look at performance related information


There are some useful logging tools built into Portlet Factory that can help look at performance. For example:
- Server stats. Server statistics are recorded in a log file in deployed WAR files whenever the server is running. The server stats logging records statistics about requests to the Portlet Factory application every five minutes. This can provide valuable information about the "health" and performance of the application, and is most useful for looking at servers under load, either in testing or production. Since server stats logging does not add any significant performance overhead, it is recommended that they are left enabled (as they are by default). The server statistics are written to WEB-INF/logs/serverStats.txt.
- Model action tracing. This feature lets you see all the actions that take place during server requests to a model. It shows the sequence of operations, such as calls to methods and page display, with elapsed time for each. This is most useful for looking at application behavior for a single user during testing.
- Session size diagnostics. This feature lets you see all the variables that are in use by a running application. It can help you find areas where you may be putting a lot of data into session, for example, by retrieving a large data set. Like model action tracing, this is most useful for targeted testing with a single user.
This tech note has more information on these features: Techniques to enhance WebSphere Portlet Factory application performance

For analyzing overall Java heap memory use, the verbose GC logging should be enabled in the application server. This log file (native_stderr.log) can be conveniently viewed with the PMAT tool available on developerWorks (http://www.alphaworks.ibm.com/tech/pmat).
These slides describe some of the performance analysis tools that are used with Portlet Factory: Portlet Factory Performance Analysis Tools.

Use automated load testing tools to validate the performance and capacity of your application


In order to find the capacity for a particular application, for example to know how many concurrent users can be accommodated on a single server, there is no substitute for automated load testing of the application. Every application is different, and it is often not possible to extrapolate between applications.

See the WebSphere Portal and WebSphere Application Server tuning guides for recommendations to optimize server performance


For WebSphere Portal, see the IBM WebSphere Portal Version Tuning Guide

Be aware of the impact of WebSphere Portlet Factory profiling features


When you use profiling, each unique profile will generate its own "WebApp" object in memory, with metadata describing the pages, methods, variables, and so forth for the model. Each WebApp also has separate cached results when you use the Cache Control builder or the caching features of Service Operation and Lookup Table. Therefore you should avoid having a very large number of different profiles for a model. For example, if you allow individual users to edit profile values with the "Edit" mode in Portal, you might potentially end up with a separate WebApp for every user. See the next item for how to avoid this.
Also, when you are using caching, if you can cache data in an unprofiled model such as a service provider model, this is better than caching data in a profiled model, since you'll have a single shared cache instead of multiple entries. On the other hand, if you need profile-specific cache results, you can get them by caching in the profiled model

When using profiling for Personalize support in WebSphere Portal consider using the Execution Time setting for profile entries


When you allow users to edit individual values in "Edit" mode, you may have a potential situation where each user ends up with their own generated WebApp (see information above on the impact of profiling). The "Execution Time" setting for profile entries can, in some scenarios, allow you to avoid this, by having the developer indicate which profile values are simple runtime values that don't require a unique regen. This technique can also be valuable in other situations (in addition to Edit mode) where you may have a large number of unique profiles.
To edit this setting, open up the profile set by double-clicking the ".pset" file, then go to the "Entries" tab, select the desired profile entry and click the "Edit" button. The choice for Execution Time is at the bottom of that dialog box. Note that you can only use this choice when the associated profiled builder input can accept a runtime value such as a variable reference. It cannot be used when profiling a value which would result in different generated code, such as the filename for the Imported Page builder.

Utilize the capabilities of external systems when possible


Instead of using a Method / LJO to categorize, sort, compute, or sum data from an external source, let the external data storage system to do the work for you. Usually sources such as databases are much better equipped to handle such tasks.

Disable testing support in service provider models


Before deploying, you should disable service testing by unchecking the "Add Testing Support" in the Service Definition builder (or disabling the Service Test builder if you are using that). The generation of service test pages uses some additional memory when models are generated.

Avoid excessive logging and related String construction


Logging code that generates a lot of output should be disabled in production and load testing, and only enabled selectively if needed. In all logging code, the code should first test to see if logging is enabled before constructing String objects for log output, since the String construction itself can use a lot of temporary memory.

 

Client (Browser) side performance concerns

For portlets, the portal page should be loading Dojo and not the portlet itself, so customization (eg, an optimized build) of Dojo should be done for the portal theme/page.

 

WebSphere Portal provides the following documentation for how you can do a custom (eg, optimized) Dojo build for use with Portal:
http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Customizing_Dojo_in_IBM_Portal
 
Note,  for apps that are limited to older browsers with limited Javascript performance, you may want to limit the amount of Dojo/Javascript that is required to use the application on such older browsers.

WebSphere Portal 7.0.0.2 and later provides optimized theme capabilities, where Dojo, optional Dojo/dijit modules and similar Javascript/CSS components may be loaded in a combined portal request, allowing for significantly fewer request than necessary with earlier releases for the same rich ui functionality.

 


expanded Article information
collapsed Article information
Category:
Best Practices, Best Practices for Web Experience Factory,
Tags:
Best practices, performance

This Version: Version 75 March 1, 2012 11:44:24 AM by Michael Burati  IBMer

expanded Attachments (0)
collapsed Attachments (0)

 


expanded Versions (75)
collapsed Versions (75)
Version Comparison     
Version Date Changed by               Summary of changes
This version (75) Mar 1, 2012 11:44:24 AM Michael Burati  
74 Feb 12, 2010 3:28:54 PM Mike Burati  
73 Feb 12, 2010 3:19:10 PM Mike Burati  
72 Feb 12, 2010 3:17:48 PM Mike Burati  
71 Feb 12, 2010 3:13:26 PM Mike Burati  
70 Feb 12, 2010 3:07:16 PM Mike Burati  
69 Feb 12, 2010 3:05:58 PM Mike Burati  
68 Feb 11, 2010 4:15:05 PM Amanda J Bauman  
65 Feb 11, 2010 4:10:26 PM Rob Flynn  
64 Feb 11, 2010 4:10:02 PM Rob Flynn  
63 Feb 11, 2010 4:09:17 PM Rob Flynn  
62 Feb 11, 2010 4:08:52 PM Rob Flynn  
61 Feb 11, 2010 4:08:32 PM Rob Flynn  
60 Feb 11, 2010 4:08:08 PM Rob Flynn  
59 Feb 11, 2010 4:07:32 PM Rob Flynn  
58 Feb 11, 2010 4:06:13 PM Rob Flynn  
57 Feb 11, 2010 4:05:25 PM Rob Flynn  
56 Feb 11, 2010 4:04:45 PM Rob Flynn  
54 Feb 11, 2010 4:03:32 PM Rob Flynn  
53 Feb 11, 2010 4:02:23 PM Rob Flynn  
53 Feb 11, 2010 4:00:19 PM Rob Flynn  
52 Feb 11, 2010 3:54:17 PM Rob Flynn  
51 Feb 11, 2010 3:58:09 PM R Flynn  
51 Feb 11, 2010 3:53:01 PM Rob Flynn  
50 Feb 11, 2010 3:52:26 PM Rob Flynn  
50 Feb 11, 2010 3:52:26 PM Rob Flynn  
47 Feb 11, 2010 3:43:33 PM Mike Burati  
47 Feb 11, 2010 3:51:04 PM Rob Flynn  
46 Feb 11, 2010 3:42:03 PM Mike Burati  
46 Feb 11, 2010 3:42:03 PM Mike Burati  
45 Feb 11, 2010 3:40:18 PM Mike Burati  
44 Feb 11, 2010 3:37:55 PM Mike Burati  
43 Feb 11, 2010 3:36:17 PM Mike Burati  
42 Feb 11, 2010 3:35:26 PM Mike Burati  
41 Feb 11, 2010 3:34:49 PM Mike Burati  
40 Feb 11, 2010 3:31:07 PM Mike Burati  
39 Feb 11, 2010 3:16:06 PM Mike Burati  
38 Feb 11, 2010 2:29:51 PM Mike Burati  
37 Jan 4, 2010 10:46:34 AM Rob Flynn  
36 Jan 4, 2010 10:45:20 AM Rob Flynn  
35 Jan 4, 2010 10:40:48 AM Rob Flynn  
34 Nov 28, 2009 8:29:14 AM Jonathan Booth  
33 Oct 2, 2009 2:41:35 PM Mike Burati  
32 Jun 22, 2009 3:37:20 PM Jonathan Booth  
31 Apr 2, 2009 4:29:16 PM Mike Burati  
30 Apr 2, 2009 2:45:42 PM Mike Burati  
29 Apr 2, 2009 2:43:05 PM Mike Burati  
28 Apr 2, 2009 2:39:37 PM Mike Burati  
27 Apr 2, 2009 2:28:37 PM Mike Burati  
26 Apr 2, 2009 2:26:12 PM Mike Burati  
25 Apr 2, 2009 2:01:07 PM Mike Burati  
24 Apr 2, 2009 1:59:48 PM Mike Burati  
23 Apr 2, 2009 1:40:58 PM Mike Burati  
22 Apr 2, 2009 9:00:37 AM Mike Burati  
21 Dec 16, 2008 11:26:43 AM Jonathan Booth  
20 Nov 26, 2008 4:08:06 PM Jonathan Booth  
19 Nov 2, 2008 10:44:10 AM Jonathan Booth  
18 Nov 2, 2008 10:42:39 AM Jonathan Booth  
17 Oct 7, 2008 1:03:29 PM DeAnna Steiner  
16 Oct 7, 2008 1:03:04 PM DeAnna Steiner  
15 Aug 6, 2008 3:22:55 PM Jonathan Booth  
14 Aug 6, 2008 3:20:28 PM Jonathan Booth  
13 Aug 6, 2008 3:19:15 PM Jonathan Booth  
12 Aug 6, 2008 3:18:20 PM Jonathan Booth  
11 Aug 6, 2008 3:17:38 PM Jonathan Booth  
10 Jul 16, 2008 11:55:20 AM Jonathan Booth  
9 Jul 16, 2008 11:52:14 AM Jonathan Booth  
8 Jun 24, 2008 2:23:28 PM Rob Flynn  
7 Jun 24, 2008 2:19:05 PM Rob Flynn  
6 Jun 13, 2008 1:01:44 PM Rob Flynn  
5 Jun 12, 2008 4:01:59 PM Rob Flynn  
4 Jun 4, 2008 2:49:05 PM Rob Flynn  
3 Jun 2, 2008 3:45:04 PM Rob Flynn  
2 Jun 2, 2008 2:50:34 PM Rob Flynn  
1 May 22, 2008 2:24:05 PM Rob Flynn  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • IBM Social Business User Experience Blog
  • IBMSocialBizUX on Twitter
  • IBMSocialBizUX on Facebook
  • Lotus product forums
  • IBM Social Business UX blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use