You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lixin Chu <li...@gmail.com> on 2006/01/27 01:11:05 UTC

data in session affecting performance ?

Hi,
I saw a thread discussing this but can not find it anymore now. I remember
someone mentioned that the amount of data put into the session context
should not exceed 32KB in general otherwise performance might be affected.

I may interpreted it wrongly. so i would like to clarify if it is indeed the
case and does this also means that a session scoped ActionForm is really bad
in terms of performance ?

thanks
lixin

Re: data in session affecting performance ?

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Yes, that would be my advice.  Further, I would try and architect your 
solutions in such a way as to not even require session as much as that 
is possible.  Clearly it won't always be, but every little bit helps :)

Frank

Lixin Chu wrote:
> 
> thank you very much - my memory is not too rusty then - at least I 
> remember the 32kb threshhold :-(
>  
> ok, so my takeaway is that, in general it is ok to use a session scoped 
> ActionForm with some minimum data but for large list/set we better look 
> it carefully. Putting them into request scope might be a better choice, 
> if we have sort of cache supported I guess.
> 
> 
> ------------------------------------------------------------------------
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 1/27/2006

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: data in session affecting performance ?

Posted by Lixin Chu <li...@gmail.com>.
thank you very much - my memory is not too rusty then - at least I remember
the 32kb threshhold :-(

ok, so my takeaway is that, in general it is ok to use a session scoped
ActionForm with some minimum data but for large list/set we better look it
carefully. Putting them into request scope might be a better choice, if we
have sort of cache supported I guess.

Re: data in session affecting performance ?

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Hi Lixin,

That was in all probability a comment I made in a thread... the 32k 
limit used to be a recommendation from IBM.  The reason was that in a 
clustered environment, the session replication time across nodes was a 
big concern.  Even on a single server the container managing persistence 
of a larger session object could be shown to be a performance and 
scalability hindrance.

32k was what they found to be the largest value before a significant 
degradation was seen to occur.  It is possible this threshold would be 
different in other containers, this was with regard to Websphere, but 
they always said it was a general recommendation, so I always stuck to it.

I'd say if you aren't in a clustered environment, the concern is 
decreased a bit, but then again, you wouldn't want to design your apps 
in such a way that moving to a clustered environment all of a sudden 
caused problems with your app.

All that being said, it is true that many frameworks these days are 
using session more and more.  It is also true that many people are 
starting to use session more and more in general.  My own personal 
opinion is that you should minimize session use whenever possible, but 
many smart people feel that it is OK to use session as much as you want. 
  In terms of ActionForms, I'd say it depends what is in the forms... if 
it's just user-entered parameters, it probably won't be too big anyway, 
and that's fine.  If your storing big lists of stuff, I would tend to 
look for another approach, but that's just my opinion.

Frank

Lixin Chu wrote:
> Hi,
> I saw a thread discussing this but can not find it anymore now. I remember
> someone mentioned that the amount of data put into the session context
> should not exceed 32KB in general otherwise performance might be affected.
> 
> I may interpreted it wrongly. so i would like to clarify if it is indeed the
> case and does this also means that a session scoped ActionForm is really bad
> in terms of performance ?
> 
> thanks
> lixin
> 
> 
> 
> ------------------------------------------------------------------------
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.14.23/240 - Release Date: 1/25/2006

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org