Page 1 of 1

Server Load - Sessions?

Posted: Fri Aug 04, 2006 2:37 am
by Terriator
Hi, currently I'm running very high traffic on my website, hence I'm trying to provide it with a new server to deal with it.

But, while waiting for my new server to be set up, I'm experiencing a rather annoying problem: My users keep getting logged out, as a result of what I think is the server crapping out. It seems as if the sessions are just eliminated at random times? Or is it something else?

And of course, what can be done about it? If anything?

Thanks!

- Terriator

Posted: Fri Aug 04, 2006 4:30 am
by shiznatix
you could use database sessions. how many users are really on your site at any given time? what exactally are you storing in the sessions?

Posted: Fri Aug 04, 2006 7:16 am
by Terriator
How does one use database sessions?

I only store a username and such - Nothing much.

I guess it comes up to around 400, perhaps 500 users when all the amaricans are online =) ..

Posted: Fri Aug 04, 2006 8:20 am
by Jenk

Posted: Fri Aug 04, 2006 8:27 am
by Ollie Saunders
It seems as if the sessions are just eliminated at random times? Or is it something else?
Yep, that could very well be exactly what is happening. link

Posted: Fri Aug 04, 2006 8:37 am
by Jenk
That directive in the php ini does NOT indicate that session will expire randomly, it is to set how probable the garbage collection process is to run. The directive session.gc_maxlifetime dictates how old session data must be before PHP will remove it.

However, the host could be deleting session data via a cronjob to empty the temporary directories, which is common.

Posted: Fri Aug 04, 2006 1:27 pm
by feyd
A basic example of database sessions is linked from Useful Posts.