-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi everyone,
I've set the session timeout in zk.xml to 1 hour.
That works fine so far.
I assume that ZK holds the session in the server's RAM and the next time the user visits the zk web application, it checks if more than 1 hour has passed or not. If more than 1 hour passed, it destroys the old session, if not, it loads the app with the data from the session.
Now, I was asking myself: If a user never comes back. Does that mean that the session never gets removed from RAM?
Valmar,
I think you'll find that timeout handling is a function of the web/application server (Tomcat/Jboss etc) and not part of ZK. So Tomcat says to itself - look this seesion has been inactive for more than the timeout limit - I'll terminate it.
So in short, no the session does not remain in RAM after the timeout.
Bobzk
Hm, I see. Thanks for your reply.
I was asking because there seems to be a memory issue in my ZK app.
For some reasons, RAM seems to become full after 2-3 days and then the server starts to allocate virtual memory on the harddisc. All the swapping between RAM and HDD then makes the CPU go up to 120% load which makes the server really slow.
A Tomcat restart solves this issue.
I thought there are some not-necessary sessions out there which need to be removed.
Is your ZK app the only thing running on Tomcat?
Also, memory will go up as time passes but it all depends on what values you have set for various pools. Memory and pool allocation in Tomcat is a science in its own right (:-)
Generally the default allocations are never enough.
Have a look at PSIPROBE to see what sessions are active, what memory is in use etc. BUT remember psiprobe will use memory/resources, so I would not use it at a busy time - it may just tip your system over the limits and cause a problem - start during low usage and se how it goes and build it up to use during peek usage as you gain experience.
Lastly, I would (but only you know your application) return to the default timeout of 30 minutes. Do you really want transactions sitting around for 60 minutes after the last use? Holding memory? Maybe even go down to 15 minutes?
Hm, I am starting to suspect some threads in my app to be stuck.
Started to observe that now.
I've also set a thread pool of 3000 since each user can fire up quite some threads (usually 2-10).
Regarding the timeout setting: Some users even want 24h sessions (and more). Is there a way to persist these session to a db so that RAM won't get filled up with these?
Nope, I want the user to be auto-logged in when they come back (unless they logged out explicitly last time).
Hm, that's a good idea!
Thanks for the tip. I'll give it a try.
Asked: 2011-09-10 14:55:51 +0800
Seen: 297 times
Last updated: Sep 12 '11