问题
I know the best way for storage PHP SESSION
is "handle in memcached" in PHP cluster.
But, I want to know whether anyone storage PHP SESSION files in NFS (Networked File System), GFS or HDFS?
I want to know whether it had some risk? or performance not well?
I think it can be provide SSO.
回答1:
The short answer is that you shouldn't use something like NFS for session management because it doesn't handle locking correctly on the distributed session files that could be accessed by any of the client servers. Plus, a lot of solutions don't correctly handle asynchronous reads.
Plus, if your networked file system "goes away", you will be in a real mess, because you get into a situation where you need to start detecting the bad mount in your PHP application.
That said, you could roll out NFS for session management if you expect low throughput, but to be honest, there are better solutions out there.
If I had to rank... I'd say any of the in memory stores are best. Memcache/Redis. I like using Redis with 5 minute writes to disk.
回答2:
It can technically be done but the performance would be subpar. The fastest medium to store data is always the memory, which is why in-memory solutions like memcached are recommended for session data storage. There is overhead in writing the data back to disk, and even a bigger overhead in connecting to a networked hd, and then perform the write on that disk.
来源:https://stackoverflow.com/questions/12552955/why-not-storage-php-session-on-a-nfs-volume