是memcached可与ASP.NET状态服务器? [英] Is Memcached interchangeable with ASP.NET State Server?

查看:193
本文介绍了是memcached可与ASP.NET状态服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在负载平衡的Web服务器环境中使用ASP.NET和WCF服务,在服务层中使用Memcached的。

I use ASP.NET and WCF services in a load balanced web server environment, using Memcached in the service layer.

我也想更换使用ASP.NET状态服务器(会话状态)与Memcached的的。 现在,恐怕不是一件好事,因为从我个人理解, Memcached是一个缓存服务器,而不是服务器的状态,是真的吗?

I also wanted to replace the use of ASP.NET State Server (for Session State) with Memcached. Now I am afraid it is not a good thing, because from what i understand, Memcached is a cache server rather than a state server, is that true?

如果我理解正确的话,memcached是没有分配Memcached的农场数据到其他节点。 相反,一个特殊的散列算法被用来确定哪个场中的一个节点包含一个请求的键的数据, 在最短的时间已经增加,至prevent失败的一个点。而ASP.NET状态服务器分发数据

If I understand correctly, Memcached is not distributing data to other nodes in the Memcached farm. Instead, a special hashing algorithm is used to determine which one of the nodes in the farm contains the data of a requested key, whereas ASP.NET State Server distributes data ASAP when it has been added, to prevent a Single Point of Failure.

在换言之,Memcached的应仅出于性能原因使用的,存储在其中的数据应该总是被重新可创建, 万一该项目已被除去以腾出空间给新的对象,或在所述单个机器实际存储的数据就下

In other words, Memcached should be used only for performance reasons, the data stored in it should always be re-creatable, in case the item has been removed to make room for new objects, or in case the single machine actually storing the data went down.

所以,我不能靠Memcached的只用于存储会话状态数据? 如果做不到的话,我不知道如何Memcached的经常被比作和被视为 除了使用ScaleOut的StateServer和ASP.NET状态服务器, 因为这些是真的状态的服务器,这是另一回事,对吧?

So can I not rely on Memcached only for storing session state data? If i can't, then i don't understand how Memcached is often compared to and seen as an alternative to using ScaleOut StateServer and ASP.NET State Server, since these are really state servers, which is another thing, right?

我现在有点不能确定什么是高性能的分布式Web服务器场中的会话状态的最佳方法。

I am now a bit unsure as to what is the best approach for high performance distributed session state in a web server farm.

感谢

推荐答案

Memcached的不支持数据镜像在present,它仅提供了分裂能力条目跨倍数服务器尝试prevent 1从得到淹没。该作品以任何散列与服务器的地址,你的密钥,或使用一致的散列算法(libketama)。

Memcached doesn't support data mirroring at present, it only provides the ability to split your entries across multiples servers to try to prevent one from getting swamped. This works by either hashing your key with the address of the server, or by using the consistent hashing algorithm (libketama).

在一般虽然,Memcached的不应该被看作是一个持久存储层,并且在几乎所有的情况下,在高速缓存中的数据应是一样的,在数据​​库中。如果您正在更改用户的会话数据,并要对其进行缓存,在Memcached的更新,然后在数据库中随即更新。如果你要非常小心,你可以实现一个简单的日志式系统,以确保这些数据停留在系统发生故障的情况下是一致的。

In general though, Memcached should not be viewed as a persistent storage layer, and in almost all cases, the data in the cache should be the same as in the database. If you are making a change to a user's session data and want to cache it, update it in Memcached, then update it in the database immediately afterward. If you want to be really careful, you could implement a simple journalling system to make sure this data stays consistent in the case of a system failure.

Memcached的肯定是正,虽然用于缓存的会话,创作者说,尽可能多的Jinux杂志的文章。这是真的只是针对优化读取操作,在这一天结束时,你关心的应该存储在数据库中的任何数据。

Memcached is definitely being used for caching sessions though, the creator says as much in a Jinux Journal article. It is really only meant for optimizing read operations, at the end of the day, any data you care about should be stored in the database.

这篇关于是memcached可与ASP.NET状态服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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