使用会话状态提供程序,每个会话是否都有自己的区域?

问题描述:

我一直在玩AppFabric Beta 2的会话状态提供程序。  似乎每个新会话都有自己的区域(名为"Default_Region_XXXX"(其中XXXX是一个明显的随机数字序列)。如果我正确理解了区域,则看起来每个区域都绑定到一个群集主机留下单点故障。 为什么每个会话都被赋予它自己的区域?

I've been playing around with AppFabric Beta 2's session state provider.  It appears that each new session get its own region (named "Default_Region_XXXX" (where XXXX is an apparent random sequence of numbers).  If I understand regions correctly, it appears that each region is tied to a single cluster host, leaving a single point of failure.  Why is each session being given it own region?

此外,会话最终会超时并在缓存中自行清理,或者该行为是否仅从缓存设置继承? 我想知道(如果在生产应用程序场景中),如果除了其他应用程序缓存之外,会为会话状态使用单独的命名缓存吗?

Also, do sessions eventually timeout and clean themselves up in the cache or is that behavior just inherited from the cache settings?  I'm wondering (if in a production application scenario), if one would use a separate named cache for session state apart from other application caches?

 

谢谢。

以上实际上并非如此。我们不创建您看到的区域"Default_Region_XXXX"是我们默认在每个缓存中创建的区域。只需要在web.config中指定一个命名缓存(我们假设如果没有指定,则为默认的
缓存)并将数据插入该缓存中的一个默认区域。

The above is actually not true . We do not create a region per session . The regions which you see "Default_Region_XXXX" are regions which we create by default in every cache . One just needs to specify a named cache in the web.config ( we assume a default cache if this is not specified ) and the data is inserted into one of the default regions in that cache .

会话最终会超时并自行清理。我们继承会话超时属性,最终数据到期。人们还可以明确地呼叫HttpSessionState.Abondon 从缓存中清除会话的数据。

The sessions do eventually timeout and clean themselves . We inherit the session timeout property and eventually the data expires . One can also explicitly call HttpSessionState.Abondon  to clear the session's data from the cache .

我仍然建议为会话中的数据使用单独的命名缓存。您可以为会话中的数据使用一个命名缓存,为应用程序缓存使用一个或多个单独的命名缓存。

I would still recommend using a separate named cache for data in session(s) . You may use one named cache for data in sessions and one or more separate named caches for the application caches .

谢谢,

Harish Kumar Agarwal

Harish Kumar Agarwal