c# - AppFabric 缓存服务器和 Web 应用程序在同一台物理机器上

标签 c# .net caching appfabric distributed-caching

我正在考虑为我们的一个项目使用 AppFabric 缓存功能。 我们需要分布式缓存功能,AppFabric 似乎是一个很好的解决方案。 不过,我有几个问题希望能在这里得到解答。

我们正在考虑在安装我们的网络应用程序的同一台机器上托管 AppFabric 缓存服务器。我在 MSDN 文章中发现 AppFabric 应该安装在专用机器上。还注意到 AppFabric 可以与应用程序本身安装在同一台机器上,但应该考虑一些问题(引自文章):

Windows Server AppFabric cache hosts should be dedicated to the caching service, which means that those servers are not also used as application, web, or database servers. It is possible to use non-dedicated cache servers in a cluster, but this scenario is not supported. Despite this policy, if you decide to use non-dedicated cache hosts, make sure to properly estimate and test the configuration for each cache host to allow enough memory and network resources for both the caching service and all other services on the machines. Also understand that spikes in processor and network utilization by other services will negatively impact the performance and stability of the cache cluster.

这是这篇文章的链接:Article #1

现在,这听起来很合理,我认为限制 AppFabric 缓存可以使用的 RAM 数量就足够了。但是,阅读 MSDN 上的另一篇文章我发现了这一点:

For both physical and virtual machines, you should note the location of the cache cluster to the application or web servers that use the cache. If they are in separate data centers, make sure that the latency between those datacenters will not negatively affect your performance. At this stage it might be tempting to use your application or web servers for your cache servers. Although possible, this is not supported. First, any resource usage spikes by services such as IIS on those machines could impact the cache cluster. Second, the caching service assumes that it is on a dedicated server and can potentially use more much more memory than you specify.

这是这篇文章的链接:Article #2

如果我正确理解上面的陈述,这意味着尽管我对 AppFabric 进行了配置设置,但它会根据需要占用尽可能多的 RAM?这真的是真的吗?有人在应用程序和 AppFabric 位于同一台机器上的配置方面有过一些经验吗?

最佳答案

为了在 appfabirc 上分享我的故事,我们开始在共享服务器上使用 appfabric 缓存,但由于以下问题最终不得不将其删除......

  1. 我们试图在其中保存对象,并且您必须序列化整个图形并将其发送到服务器,在高需求场景中,不确定它比从 db 本身提取效率高多少.此外,您可以告别任何委托(delegate)或事件连接,或对象中的异步操作。

  2. 缓存服务本身会间歇性地抛出错误,指出它不可用,然后您将不得不使用 powershell 检查它的健康状况。此外,只要您的盒子使用超过 90% 的内存,它就会停止工作。

  3. 即使盒子上有一点内存压力,它也会积极尝试从缓存中逐出项目,并且为此总是占用大约 10-20% 的 cpu....

总而言之,我认为 MS 的建议是正确的,它需要有自己的专用集群,但话又说回来,每个应用程序都有自己独特的需求,您应该根据部署环境中的参数对其进行评估。

关于c# - AppFabric 缓存服务器和 Web 应用程序在同一台物理机器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8148512/

相关文章:

c# - WWW/UnityWebRequest POST/GET 请求不会从 server/url 返回最新数据

c# - 在 ASP.Net 应用程序中安全地存储(加密)数据

ios - 使用 AFNetworking 时,应用程序未下载最新的 plist。缓存?

caching - 如何在Redis缓存列表中按元素值查找?

sqlite - 使用文件或 sqlite 数据库缓存数据哪个更好?

c# - 传递 Ninject 内核是一个好习惯吗?

c# - WPF MVVM Light Toolbox with Entity framework c# simple linq

c# - 从字典中获取第一个元素

c# - .NET 中性能至上且数据形式不重要的场景的最佳序列化?

c# - 如何在 NetworkStream 字节数组中放置分隔符?