Session store in memory.

php.internals

Ján Šuňavec

23 years ago
Hi I have one idea. Store session data in memory instead file. It's fast when file. Yes I know when script is finish all data is delete. But this can be same like file session. But in memory. Akelavlk ====================== REKLAMA ================================= Vyrazne zlavy pocitacov a prislusenstva Toshiba Pocket PC e740 v cench u? od 24.300,- Sk bez DPH Navstivte nas na adrese http://www.somi.sk/akcie.php ================================================================

Sander Roobol

23 years ago
On Wed, Mar 26, 2003 at 02:02:55PM +0100, J?n ?u?avec wrote:
> Hi > > I have one idea. Store session data in memory instead file. It's fast > when file. Yes I know when script is finish all data is delete. But > this can be same like file session. But in memory.
There already are various ways to do this: -enable mm support for session storage (--with-mm) -store your session files on a ramdisk -use ext/shmop Sander

Antony Dovgal

23 years ago
On Wed, 26 Mar 2003 14:02:55 +0100 JАn ╘uРavec <jansun@pobox.sk> wrote: http://php.net/session To use shared memory allocation (mm) for session storage configure PHP --with-mm[=DIR] . You're late. Check the manual for additional info.
-- Wbr, Antony Dovgal aka tony2001 mailto:tony2001@phpclub.net http://phpclub.net --- Stand for something or you will fall for nothing.

Chris Field

23 years ago
You can do this your self using shared memory segments and custom session handling functions. There are lts of good reasons to leave them in files, one is that you can have an NFS volume that a group of servers can share letting you have the luxury of sessions behind a loadbalancer. On Wed, 2003-03-26 at 08:02, Ján Šuňavec wrote:
> Hi > > > > > I have one idea. Store session data in memory instead file. It's fast > when file. Yes I know when script is finish all data is delete. But > this can be same like file session. But in memory. > > > > > Akelavlk > > > > ====================== REKLAMA ================================= > Vyrazne zlavy pocitacov a prislusenstva > Toshiba Pocket PC e740 v cench u? od 24.300,- Sk bez DPH > Navstivte nas na adrese http://www.somi.sk/akcie.php > ================================================================
-- Chris Field cfield@affinitysolutions.com Affinity Solutions Inc. 386 Park Avenue South Suite 1209 New York, NY 10016 (212) 685-8748 ext. 32

George Schlossnagle

23 years ago
This is a conversation for php-general, not here. But...
> There are lts of good reasons to leave them > in files, one is that you can have an NFS volume that a group of > servers > can share letting you have the luxury of sessions behind a > loadbalancer.
ack, that's awful! Session id's aren't unique across clusters of machines. You'll risk session corruption.

Sascha Schumann

23 years ago
> ack, that's awful! Session id's aren't unique across clusters of > machines. You'll risk session corruption.
They are not guranteed to be unique, even on a single host. Spreading your load across multiple machines actually decreases the probability of a collision, because the diversity of local time counters and LCG states increases. I've thought about adding $_SERVER["SERVER_ADDR"] to the input stream, but I don't consider it as essential. - Sascha

George Schlossnagle

23 years ago
On Wednesday, March 26, 2003, at 01:25 PM, Sascha Schumann wrote:
>> ack, that's awful! Session id's aren't unique across clusters of >> machines. You'll risk session corruption. > > They are not guranteed to be unique, even on a single host.
There's also the problem of file locking on nfs mounts.

Sascha Schumann

23 years ago
> There's also the problem of file locking on nfs mounts.
That's true for 3-5 year old Linux boxes. Try running a proper NFS setup. - Sascha

George Schlossnagle

23 years ago
On Wednesday, March 26, 2003, at 01:31 PM, Sascha Schumann wrote:
>> There's also the problem of file locking on nfs mounts. > > That's true for 3-5 year old Linux boxes.
Last I checked there were reliability problems with locking implementations across NFS on many UNIXes.
> Try running a proper NFS setup.
Thanks for the tidbit, I'll look into that.

Sascha Schumann

23 years ago
> Last I checked there were reliability problems with locking > implementations across NFS on many UNIXes.
Well, if you want to deploy a NFS-based web cluster, you will very likely not choose some heterogeneous setup with incompatible NFS implementations. As if that was not obvious. - Sascha

George Schlossnagle

23 years ago
On Wednesday, March 26, 2003, at 01:52 PM, Sascha Schumann wrote:
>> Last I checked there were reliability problems with locking >> implementations across NFS on many UNIXes. > > Well, if you want to deploy a NFS-based web cluster, you will > very likely not choose some heterogeneous setup with > incompatible NFS implementations.
Or you implement a storage architecture that doesn't rely on unreliably implemented OS features.
> > As if that was not obvious.
Everything is obvious to the author.

Sascha Schumann

23 years ago
> Or you implement a storage architecture that doesn't rely on unreliably > implemented OS features.
George, I would appreciate some constructive messages from you. This thread contained mostly FUD from your side. - Sascha