Tuning and optimizing webcenter spaces application white paper

1,377 views

Published on

This white paper focuses on Oracle WebCenter Spaces performance problem and analysis after post production deployment. We will tune JVM ( JRocket). Webcenter Portal, Webcenter content and ADF task flow.

Published in: Technology

Tuning and optimizing webcenter spaces application white paper

  1. 1. 12/9/2013 An Oracle White Paper - Tuning and optimizing Webcenter spaces applica- tion This white paper focuses on Oracle WebCenter Spaces performance problem and analysis after post production deployment. We will tune JVM ( JRocket). Webcenter Portal, Webcenter content and ADF task flow. Vinay kumar
  2. 2. Table of Contents Introduction ....................................................................................................2 Application Architecture ................................................................................3 Analysis of Code base of Application.........................................................3 Result of Performance analysis is as below - .............................................4 Performance Optimization -........................................................................5 Tuning in Custom Task flow application in ADF side -.............................7 Preferred changes in web.xml – ............................................................8 Tuning JVM (JRockit) ................................................................................8 Tuning Webcenter Portal (Spaces)..............................................................9 Tuning Webcenter Content........................................................................10 Summary ...................................................................................................11 About the Author.......................................................................................11
  3. 3. Introduction I have been given task of analysis and tuning of Webcenter Spaces application, which using custom task flow build on Oracle ADF for our customer. This article is based on my analyzed data while performance optimization but will be useful for any other Oracle Webcenter Portal (Spaces) applications. This application deployed on customer site. Issues persist with time, as data increase down the line and loading of home page and other pages taking time around 20 to 30 Seconds. Goal is to reduce to acceptable time frame. The article covers the findings, research and recommendations and includes the best practices that can be applied to generic WebCenter Spaces applications as well custom task flow application. The following area are main effected for performance tuning. 1. Oracle Webcenter Spaces API 2. Oracle WebCenter Spaces1 Application Tuning 3. ADF Task Flow The Oracle WebCenter Spaces application examined in this article is based on Oracle WebCenter Patch Set 4 with Oracle Weblogic Server 11.1.1.5. Performance analysis done on various tool like Jmeter,Oracle Enterprise Manager Control, and third party browser plugins including Firebug. I will also list down the solution made for performance optimization and best practices. Environment: → Oracle ADF → Oracle WebCenter 11.1.1.5 → Oracle Webcenter Content
  4. 4. Application Architecture Application consist of various spaces .It uses Webcenter content in behind. All user information and application information stored in Webcenter Content , which is integrated through RIDC API. Regarding Webcenter Spaces information, spaces user information and custom attributes of spaces are stored in Webcenter spaces. Analysis of Code base of Application For performance analysis , I tried with Jmeter and result are not very good with a lot of data and multiple request to RIDC api and Webcenter Spaces API classes i.e. GroupSpaceWSClient This class provides the utility methods to perform commonly used Group Space operations. GroupSpaceWSContext This class provides all the client side configuration for connecting to the group spaces web services. GroupSpaceWSMembers This class acts as place holder for storing details of members to be added added to the Group Space and to be removed from teh Group Space. GroupSpaceWSMetadata This class is responsible for providing metadata for given WebCenter
  5. 5. Group Space. Result of Performance analysis is as below - And in average result graph - Firebug - After this testing main problem is request going to WS API. For example- In one scenario – One spaces have custom attribute as moderationRequired -true for create new post. For checking that current user is able to create post on that group, one request went for checking whether user is member of that group or not, second request went to check the role of current user and third request
  6. 6. to check whether current group is require moderation or not. In above scenario, we send 3 request to check wther user should able to create post or not. Lot of request to WS API, which cause the problem. Following method used to check WS spaces information - getGroupSpaceMembersInfo(spaceName) getGroupSpaceMetadata(spaceName) getGroupSpaces() getPublicGroupSpaces() getGroupSpaceURL(groupSpace) client.getDiscoverableGroupSpaces() and many more. Performance Optimization - There are two way, I had changed application code a bit. 1.) Using expression language from SpacesQueryParameters class - for getting spaces based on various criteria . 2.) Querying the Webcenter Spaces DB tables -uerying the Webcenter Spaces DB tables 1. ) Implementation of Expression language (el) for getting information from WS API - → #{spaceContext.spacesQuery.unionOf['DISCOVERABLE'].listSpaces - expression will return the list of all discoverable group spaces → #{spaceContext.spacesQuery.unionOf['USER_JOINED'].shape['RECURSIVE_FLATTENED '].listSpaces} - returns a list of all spaces the current user is a member of and returns all the sub- spaces under each of these spaces the current user has access on → #{spaceContext.space['" + spaceName + "']} - Return instance of space. These expression language is very useful compare to using WS API using GroupSpaceWSClient and send request.for example Using below code you can get metadata of space Space mySpace = (Space)OCCViewUtil.evaluateEL("#{spaceContext.space['" + spaceName + "']}"); GSMetadata spaceMetadata = spaceMetadata = mySpace.getGSMetadata();
  7. 7. 2.) Querying the Webcenter Spaces DB tables – Instead of sending request to Webcenter Spaces API , its easy and better to fetch information for database . We have webcenter schema for getting information for Webcenter Spaces database tables. Similary we have schema for discussion, portlet producer and activity & graphs as well. See below- Component Schema Owner Dependencies WebCenter Spaces prefix_WEBCENTER prefix_MDS (Metadata Services) Portlet Producers prefix_PORTLET None. Discussions prefix_DISCUSSIONS None. Activity Graph and Analytics prefix_ACTIVITIES None. Alright, now our custom task flow application will have a model structure as well, which is not there before. We will be creating read only view object on the tables .Getting information from these db tables is very fast compare to use Webcenter Spaces API. WC_SPACE_HEADER - This table stores all the spaces in the system, their status, last updated, and other attributes like parent space and member count. WC_SPACE_USR_DETAIL - This table stores all the users in the spaces, their status, roles, and other attributes like space. WC_PEOPLE_CONN_LIST - This table stores all the connection for particular users. There are multiples tables .You can use according to your requirement. See below -
  8. 8. After creating view objects, We can get the information using executing view criteria. This will be a quick way to get information for Webcenter spaces. Tuning in Custom Task flow application in ADF side - 1. While using tree or table, use appropriate content delivery mode Possible values for this attribute are:  immediate  lazy  whenAvailable 2. Avoid inline usage of JavaScript/Cascading Style Sheets (CSS) whenever possible. 3. While using tree or table, always consider set correct fetch size (fetch size -defines the number of rows to be sent to the client in one round-trip). 4. Avoid binding UI components in backing beans, if used make them as transient 5. While using tree or table use column stretching, if really required. 6. Use "blocking=true" for and to avoid multiple clicks on submit buttons. 7. Remove unused items from page bindings. 8. Set Immediate Property to True when Appropriate. 9. Remove unused VOIterators on JSFF Page definitions. 10. Use AJAX (PPR) as much you can. 11. Ensure none of Page definitions should have more than one data control if not needed. This may result in increasing number of database connections. 12. Avoid using a af:panelStretchLayout where topHeight, bottomHeight, startWidth, or endWidth is set to “auto”.
  9. 9. 13. Don’t use JSF/ADF Faces and JavaServer Pages Standard Tag Library (JSTL) tags together. 14. Use the "visible" and "rendered" attributes wisely.  The visible property specifies simply whether the component is to be displayed on the page, or is to be hidden.  The rendered property specifies whether the component shall exist in the client page at all. 15. Keep the managed beans in the lowest possible scope in task flow. 16. While using tree or table, always consider set correct fetch size( fetch size -defines the number of rows to be sent to the client in one round-trip). 17. Ensure each backing bean/Manage bean should implement java.io.Serializble interface. Preferred changes in web.xml – org.apache.myfaces.trinidad.resource.DEBUG -False oracle.adf.view.rich.CHECK_FILE_MODIFICATION -False oracle.adf.view.rich.CLIENT_STATE_METHOD -token oracle.adf.view.rich.LOGGER_LEVEL -False or remove this entry oracle.adf.view.rich.ASSERT_ENABLED -False or remove this entry Tuning JVM (JRockit) The Oracle JRockit JVM is the industry's leading performing Java Virtual Machine now built into Oracle Fusion Middleware. It brings industry leading real time infrastructure capabilities with JRockit Real Time and unparallelled JVM diagnostics with JRockit Mission Control. As all the java processes are run and maintained by the JVM, it should be tuned properly in order to get the desired performance. The tuning can be done in terms of heap size allocated to different JVM processes, Garbage collection and other run-time parameters. 1. Tuning the Garbage Collection: Set dynamic Garbage Collection mode to Throughput Mode. And we can reduce the memory fragmentation by selecting this GC mode. Throughput mode is default when the JVM runs in -server mode (which is default), or can be enabled with the command line option -XgcPrio:throughput. For example: java -XgcPrio:throughput 2. Setting the Nursery Size: Nursery size refers to the storage for the short-lived objects , which are collected faster than old objects . This reduces the chances of very frequent Garbage collections and long pause times. It is set to optimal value by default when the GC mode is selected as throughput. It should at least 2GB. Set -Xns=4096m to increase the nursery size. 3. Setting the Heap Size on 64-bit Systems: The heap size has an impact on allocation speed,
  10. 10. garbage collection frequency and garbage collection times. A small heap will become full quickly and must be garbage collected more often .The heap allocation is a vital area which needs to be carefully tuned to increase the performance. By default 2Gb is the allocated heap for Webcenter Spaces application, which is very low. At least it should be 4GB. java -Xms:4g -Xmx:4g 4.: Add the argument –XxnoSystemGC prevents System.gc() application calls from forcing garbage collection. Tuning Webcenter Portal (Spaces) 1. Configure Portlet cache size - Change the following parameter in adf-config.xml manually <adf-portlet-config> <supportedLocales> <cacheSettings enabled="true"> <maxSize>10000000</maxSize> {default value} </cacheSettings> <adf-portlet-config> 2. Configure portlet timeout- Modify the portlet timeout value in the adf-portlet-config element of the adf-config.xml file. Default: 10 seconds, minimum: 0.1 seconds, maximum: 60 seconds. If you must modify these properties, post deployment, you must edit adf- config.xml manually. The following is a sample snippet of adf-config.xml: <adf-portlet-config> .... <defaultTimeout>5</defaultTimeout> <minimumTimeout>2</minimumTimeout> <maximumTimeout>100</maximumTimeout> </adf-portlet-config>
  11. 11. Tuning Webcenter Content 1. Setting JRockit Virtual Machine (JVM) Arguments.JVM arguments are set in the setDSSCustomDomainEnv.sh file. Heap size: If the system is overloaded, that is, garbage is collected or “out of memory error” occurs frequently, then increase the heap size as appropriate to your system's available physical memory. The parameter is: -Xms2096M -Xmx2096M -Xns2096M Security: The following JVM arguments improve performance of Webcenter application’s security layer. -DUSE_JAAS=false -Djps.policystore.hybrid.mode=false -Djps.combiner.optimize.lazyeval=true -Djps.combiner.optimize=true -Djps.auth=ACC 2. Setting System Limit -To run a WebCenter application at moderate load, set the open-files-limit to 2048.If you encounter errors, such as running out of file descriptors, then increase the system limit. For example, on Linux, you can use this command: ulimit -n 4096 (default is 1024) 3. Setting HTTP Session Timeout To manage over resource usage, adjust the session timeout value, in minutes, in the web.xml file manually. The following is a sample snippet of web.xml: <session-config> <session-timeout> 45 </session-timeout> </session-config>
  12. 12. Summary This article stepped you through the performance tuning of webcenter spaces application. Performance tuning is vast topic. It can be done timely with different environment. Real testing can be done of Webcenter Spaces application using maximum load. So designing an application architecture should be done with keeping in mind the co-current users. Still there is lot of space of tuning such as Weblogic server. To summarize, reducing the request to Webcenter Spaces API will increase the performance of Webcenter Spaces application. Tuning practice of Webcenter Spaces helps a lot to reduce the page loading time. By means of observations and preliminary testing data to 2 to 3 seconds from 20 to 30 seconds. It recommend to have model layer for fetching information from spaces. About the Author Vinay Kumar is a Senior Consultant and certified Oracle ADF/WebCenter Portal implementation spe- cialist with Silbury IT Solutions gmbH. An Oracle Fusion Middleware evangelist. Vinay has seven years of experience consulting in Oracle ADF, Oracle WebCenter Portal/Content.

×