tags:

views:

74

answers:

2

Hi, all.

Yesterday, my supervisor told me that tmp-file-based session should be THE answer to session implementation, and I should abandon any idea of making sessions persistent.

He argues that file-based session is much faster and eaiser to use than other choices like db-based or memcached-based implementations.

What he said was really a shock to my past learning experience, so please tell me whether he was wrong and why?

Thanks in advance.

A: 

Your supervisor is smoking something. File-based sessions are persistent. You need need to move a disk head to get to them, unless they happen to be in the OS file cache. One disk head move pays for a lot of memecache.

And "easier" is relative. tmp-file based sessions are easy to set up, so he's marginally right on that point.

Dave W. Smith
@Dave W. Smith: What he refered to was a volatilize way of doing this, saving session data into the /dev/shm directory, which as he said used memory only
Satoru.Logic
In that case, you're fine, as long as you craft a way of clearing out expired sessions.
Dave W. Smith
+1  A: 

/dev/shm will be faster then memcache but you have to make sure all your http requests of the same session go to the same machine each time. Distributed solutions like db-based and Memcached don't have this problem when load balancing.

NeuroScr