为什么不将PHP SESSION存储在NFS卷上? [英] Why not storage PHP SESSION on a NFS Volume?

查看:88
本文介绍了为什么不将PHP SESSION存储在NFS卷上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道最好的存储方式PHP SESSION是PHP集群中的在memcached中处理".

但是,我想知道是否有人将PHP SESSION文件存储在 NFS (网络文件系统), GFS HDFS 中? >

我想知道它是否有风险? 还是性能不好?

我认为它可以提供SSO.

解决方案

简短的答案是,您不应该将NFS之类的内容用于会话管理,因为它无法正确处理对可访问的分布式会话文件的锁定由任何客户端服务器.另外,许多解决方案不能正确处理异步读取.

此外,如果您的网络文件系统消失了",您将陷入一片混乱,因为您陷入了一种情况,需要开始检测PHP应用程序中的错误安装.

也就是说,如果您期望低吞吐量,则可以推出NFS进行会话管理,但是老实说,那里有更好的解决方案.

如果我必须排名...我会说任何内存存储区都是最好的. Memcache/Redis. 我喜欢在5分钟内将Redis写入磁盘.

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.

解决方案

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.

这篇关于为什么不将PHP SESSION存储在NFS卷上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆