Parallel Rendering of Portlet

By default the WebSphere Portlet tries to render all the portlets on page sequentially. For example if you have 4 different portlets on one page, then websphere portal will create one thread for handling the request and call render() method of each of the portlets sequentially one after another. So the total response time is Sum of execution time of all the portlets. One important point to remember is that result page wont get displayed to user until render() method of all the portlets is finished
This is acceptable behavior in most of the cases but what if you have a portlet that accesses a database/ file system and takes long time to get result in that case the page my timeout. Example one of my client had a issue that when they the portal was serving blank white page. When we debugged the issue we realized that one of the portlets was trying to access a db process which for some reason was taking very long time and as a result the Connection from ODR to Portal server was getting timed out and as a result user was getting blank page. In the same case if you try to access the portal directly then it used to take long time but it used to display output finally.
In cases like this you might want to enable parallel rendering. When you enable parallel rendering the portal server will try to create different threads and call render() methods of the portlet from different threads in parallel. One other advantage of this approach is you can set a time out by default it is 2000 milli seconds. The portal server will wait for this time and if the render() method does not finish executing in that time, the portal server will ignore that portlet and display rest of the page. Make sure that this timeout is less than your ODR or Http Server Connection timeout so that portal server does not show blank page to user.

Enabling Parallel rendering


By default the parallel rendering is disabled and you will have to enable the parallel rendering first globally at portal server level then you have to enable it at portlet level. When you enable parallel rendering at portal server level it will not open different threads for each of the portlets on the page instead it will render only portlets that have parallel rendering enabled in separate thread and other portlets on the page are still rendered sequentially.
Second important point to note is that enabling parallel portlet rendering is just a hint to WPS and it is not necessary that WPS will create separate thread for each of the portlets that are enabled for parallel rendering. It is recommended that do not enable parallel rendering for every portlet instead enable it for the portlets which really need them ex. Portlet which needs to access external resource that might take time and WSRP consumer portlet. This way WPS can use the separate threads more efficiently.

Enabling Parallel rendering at the level of Portal Server



You can change the portal wide settings for parallel portlet rendering in the PortletContainerService. You can use two different parameters for configuring parallel portlet rendering, depending on the type of portlets you want to have rendered parallel.
1)For IBM portlets enable the following parameter

legacy.useParallelRendering.html=true

2) For standard portlets or for remote portlets that you integrated in a WSRP Consumer portal, enable the following parameter

std.useParallelRendering.html=true

Please note that .html part is optional which says that enable parallel rendering only for HTML markup. In markups like WML there would be only one portlet on page so parallel rendering does not make sense
In addition there are couple of more parameters that you can set at PortletContainerService level

  • parallelRenderingTimeOut:Use this parameter to specify the timeout in milliseconds after which the render process of a portlet is aborted. Default value is 2000(2 seconds)

  • parallelRenderingWaitTimeOut:Use this parameter to specify the waiting time in milliseconds for parallel threads to finish the render process of portlet. A low value can result in exceptions caused by portlets that could not finish their parallel rendering process. A high value can cause an increase of the response time. The value 0 (zero) specifies that no timeout occurs and the main thread waits for all portlets to finish.

  • parallelRenderingWaitTimeOut:Use this parameters to specify the waiting time in milliseconds for parallel threads to finish the render process of portlets. The default is 1 millisecond. A low value can result in exceptions caused by portlets that could not finish their parallel rendering process. A high value can cause an increase of the response time. The value 0 (zero) specifies that no timeout occurs and the main thread waits for all portlets to finish.

  • parallelRenderingChunkSize:Specifies the size of the chunks in bytes that are read from the queue. The default value is 1024 bytes.


Enabling Parallel rendering at portlet level


Once the parallel rendering is enabled at portal level. You can enable it at portlet level. There are different methods for doing that depending on your role

  • Developer: If your portlet developer then you can enable the parallel rendering by using the the following parameter. You set this parameter as a configuration parameter in IBM portlets or as a read-only preference in standard portlets.parallel = (false)

  • Administrator: If your administrator you can change the setting for a portlet to parallel rendering in the Manage Portlets portlet.


Proceed by the following steps:

  1. Select Portal Administration > Portlet Management > Portlets.

  2. Select the desired portlet and click on the Configure (wrench) icon. The portal displays the panel for configuring the portlet.

  3. Mark the Enable parallel rendering checkbox to enable parallel rendering for the portlet.


When you enable a portlet for parallel rendering it should look like this.



Take a look at Infocenter for more information on Parallel portlet rendering

3 comments:

Anadi Kumar said...

C:\IBM\WebSphere\PortalServer\base\wp.services.properties\properties\PortletContainerService.properties

# Parallel Portlet Rendering
#
# Parallel portlet rendering is disabled by default, can be enabled
# for all markups or for individual markups
#
# uncomment the following lines to turn on parallel portlet rendering for HTML only

# Default: false
#legacy.useParallelRendering.html = true

# Default: false
#std.useParallelRendering.html = true


Regards,
Anadi KUMAR
Senior Software Engineer | HSBC Technology and Services - Global Technology
HSBC Software Development (India) Limited,GLT 4.0 - Panchshil Tech. Park, Block D, S.No. 19, Hissa 2A/11/2, Yerawada, Pune, 411006.
India.

Mobile:+91 99822622054
Email: anadikumar@hsbc.co.in
Email: anadikumar@gmail.com

lulur bali joss said...

salam kenal bos. lagi jalan jalan pagi nih

Abhi said...

Thanks for info
Customized Erp Solutions