Need suggestion on minimizing session usage in wicket web application

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Need suggestion on minimizing session usage in wicket web application

kshitiz
Hi,

I need some suggestions. In my wicket application (in development phase), I have used normal forms and links. While going through the concept of stateless pages and forms, I am confused about converting the forms and components to stateless. Will it really minimize session usage in the system. I need to minimize it as i wont be having much server space initially.
Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

Andrea Del Bene-3
yes, using stateless pages when it's possible will definitely reduce
your session size. Wicket offers a stateless version for those
components which by default  have a stateful nature, like forms and
links. As general rule you can implement a stateless page when the page
doesn't need to keep its internal state between two consecutive
requests. For more information on stateless pages see live examples at
http://www.wicket-library.com/wicket-examples/stateless/

> Hi,
>
> I need some suggestions. In my wicket application (in development phase), I
> have used normal forms and links. While going through the concept of
> stateless pages and forms, I am confused about converting the forms and
> components to stateless. Will it really minimize session usage in the
> system. I need to minimize it as i wont be having much server space
> initially.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

Bertrand Guay-Paquet
In reply to this post by kshitiz
Hi,

You can read the following email thread for insight:
http://wicket-users.markmail.org/thread/6qqc4pxt77mulpmt

Also have a look at this:
http://www.small-improvements.com/blog/technical/tuning-wicket-session-size

These links talk about session size in general, not only about stateless
components.

On 02/08/2012 9:25 AM, kshitiz wrote:

> Hi,
>
> I need some suggestions. In my wicket application (in development phase), I
> have used normal forms and links. While going through the concept of
> stateless pages and forms, I am confused about converting the forms and
> components to stateless. Will it really minimize session usage in the
> system. I need to minimize it as i wont be having much server space
> initially.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

kshitiz
Thanks for the links. One thing that I want to ask that do yo think we should use LoadableDetachable models to minimize session usage? Like for every thing examples labels, links, dropdowns, etc.  
Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

Bertrand Guay-Paquet
I would say it depends. Generally, it should help to use detachable
models, but for very small objects (like static strings), it's won't
give a big gain. Besides memory gains, detachable models also reload
their data each request which ensures non-stale objects.


On 02/08/2012 11:28 AM, kshitiz wrote:

> Thanks for the links. One thing that I want to ask that do yo think we should
> use LoadableDetachable models to minimize session usage? Like for every
> thing examples labels, links, dropdowns, etc.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650963.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

robmcguinness
In reply to this post by kshitiz

food for though in 6.0 branch

getFrameworkSettings().setSerializer(new DeflatedJavaSerializer(getApplicationKey()));
Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

kshitiz
This post was updated on .
In reply to this post by Bertrand Guay-Paquet
Okk....I think for large user base, I should go for stateless pages. But the problem is that my app is entirely ajax based. So, how would I use ajax behavior for stateless components. As far as I have read, ajax requires components to be stateful (http://apache-wicket.1842946.n4.nabble.com/stateless-ajax-behavior-td1933611.html). I have read about jolira components. Can it impact the application in any possible manner after integrating jolira with wicket 1.5?
Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

Martin Grigorov-4
In reply to this post by robmcguinness
On Thu, Aug 2, 2012 at 11:37 PM, robmcguinness
<[hidden email]> wrote:
>
> food for though in 6.0 branch
>
>
>
> getFrameworkSettings().setSerializer(new
> DeflatedJavaSerializer(getApplicationKey()));

This wont help for the session size. The http session keeps only the
last used page instance. The serialized page (the bytes) are stored in
disk store unless you use HttpSessionDataStore (for Google AppEngine
for example).
Read https://cwiki.apache.org/confluence/display/WICKET/Page+Storage

>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650973.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

Bertrand Guay-Paquet
In reply to this post by kshitiz
I have not used stateless ajax myself so I can't help you much there.
Have a look here for stateless ajax:
https://github.com/jolira/wicket-stateless

Also, before you make such big modifications, I suggest you take the
time to profile the memory usage of your pages. There could be a 1-hour
fix available to your problem depending on its source.

On 03/08/2012 2:48 AM, kshitiz wrote:

> Okk....I think for large user base, I should go for stateless pages. But the
> problem is that my app is entirely ajax based. So, how would I use ajax
> behavior for stateless components. As far as I have read, ajax requires
> components to be stateful
> (/http://apache-wicket.1842946.n4.nabble.com/stateless-ajax-behavior-td1933611.html/).
> Will it be possible for me to use same ajax behavior like updating panel,
> etc on stateless pages?
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650976.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

kshitiz
This post was updated on .
Actually I am planning to host the app in Google application engine. One thing I am not able to understand, getStatelessHint() if applied in the constructor of a page should return whether that page can be stateless or not. So, in my page which is full of ajax and statefull components, why it is printing true? I am simply printing...

        public Page(PageParameters pageParameters)(
                        final PageParameters pageParameters, UserDomain userDomain,
                        UserDomain loggedInUserDomain) {

// many statefull components added
System.out.println(this.getStatelessHint());  returning true..!!!!
}

how to check if page or component is stateless or not if getStatelessHint is not used for checking??
Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

Martin Grigorov-4
On Fri, Aug 3, 2012 at 5:11 PM, kshitiz <[hidden email]> wrote:

> Actually I am planning to host the app in Google application engine. One
> thing I am not able to understand, getStatelessHint() if applied in the
> constructor of a page should return whether that page is stateless or not.
> So, in my page which is full of ajax and statefull components, why it is
> printing true? I am simply printing...
>
>         public Page(PageParameters pageParameters)(
>                         final PageParameters pageParameters, UserDomain userDomain,
>                         UserDomain loggedInUserDomain) {
>
> // many statefull components added
> *System.out.println(this.getStatelessHint());*  returning true..!!!!

use #isPageStateless() instead.

> }
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650982.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

kshitiz
Ya..that worked...and for each component...I think statelessChecker is there. But I am not able to figure out how to use it for a component? I read you post http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html But not able to get...
Reply | Threaded
Open this post in threaded view
|

Re: Need suggestion on minimizing session usage in wicket web application

Bertrand Guay-Paquet
Do you use Wicket 6? If so, the latest snapshot includes an "enhanced"
page view in the page inspector of the Wicket debug bar. This page view
can be filtered to show only stateful components and behaviors.

If you're on Wicket 1.5, check out
https://issues.apache.org/jira/browse/WICKET-4244.
"stateful_page_inspector.patch" has the version I submitted for 1.5 in
November. You can have a look at the screenshots in the issue to see
what it does.


On 03/08/2012 10:44 AM, kshitiz wrote:

> Ya..that worked...and for each component...I think statelessChecker is there.
> But I am not able to figure out how to use it for a component? I read you
> post
> http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html
> http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html
> But not able to get...
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650987.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]