Saturday, July 16, 2011

ADF View State Tuning for Large WebCenter 11g PS3/PS4 Applications

While running large ADF/WebCenter 11g PS3/PS4 applications in stress test or production environment, users can experience random errors related to ADF view state token. For example such errors can be observed in the log: StateManagerImpl restoreView Could not find saved view state for token -ejrgnqgsv.

We can refer to section 8.2 Oracle ADF View Performance from Oracle Fusion Middleware Performance and Tuning Guide. It describes org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKENS property and instructs how to tune performance by reducing the size of state token cache. By default, for ADF application tokens size is set to 15 (I personally would recommend to set it to 25 and then measure application performance, if no performance issues, its better to keep available tokens value higher), it can be tuned to 2. When it is set to 1, ADF application will return error after browser Back button click. When we create new WebCenter application in JDeveloper, org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKENS is set to 3, this means WebCenter application would keep only three tokens in memory. Number of tokens is set to 3, probably to reduce memory usage for heavy WebCenter applications.


We have noticed, when Web session timeout is set to default 30 minutes, after 10-15 minutes of user inactivity - could not find saved view state for token error is be reported randomly. This is unexpected behavior, because user is not pressing browser Back button, but still gets error during inactivity, even before timeout.

This means org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKENS = 3, as it set for WebCenter 11g PS3/PS4 applications, looks like not enough. When this value was increased to 25, state token error was not reproduced anymore.

Hope this hint will help you, in case of unexpected error will be encountered for missing view state during user inactivity.

5 comments:

Anonymous said...

Note that setting this parameter to a higher value means that you are likely going to see bigger memory consumption on the JSF server per user.

Andrejus Baranovskis said...

Yes, its why I recommend to see how it affects performance and tune accordingly for each application.

But the fact is, with default value 3 for WebCenter, its not working consistent for larger WebCenter apps.

Andrejus

Achinto Banerjee said...

We also facing similar problem where the page just kept on refreshing itself in clustered env and only in IE . In mozila page will come up fine . Also , when we bypassed security stack we are using and used adf security instead the pages seemed to be working fine .
But in either case when we increased the tokens to 25 the problem could not be reproduced.
So for now we are going with increased value of 25 , but just wondering what could be an ideal value for it . Should we look to increase it further .

Thanks,

Achinto Banerjee

Andrejus Baranovskis said...

You should not increase it further, unless same issue will be reproduced again. This value highly depends on how many regions your applications is using. If its not reproduced, highly possible that 25 is good enough.

Andrejus

Baduel said...

Hi Andrejus. Very good post. I've exactly the same problem with my web application but with the value 25 the problem still occurs.

What is the next value to try? Depending on what I have to decide the correct value?

Thank you.