简体   繁体   English

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

[英]AppFabric Cache server and web application on same physical machine

I am considering using AppFabric caching feature for one of our projects. 我正在考虑为我们的一个项目使用AppFabric缓存功能。 We have a need for distributed caching feature and it seems AppFabric is a good solution. 我们需要分布式缓存功能,似乎AppFabric是一个很好的解决方案。 However, I have a few questions which I hope will be answered here. 但是,我有几个问题希望在这里得到解答。

We are considering to host AppFabric Cache server on the same machine where our web application is installed. 我们正在考虑在安装Web应用程序的同一台机器上托管AppFabric Cache服务器。 I have found on MSDN article stating that AppFabric should be installed on a dedicated machine. 我在MSDN文章中发现AppFabric应该安装在专用机器上。 It is also noted there that AppFabric can be installed on the same machine as application itself but some issues should be considered (quote from article): 还要注意的是,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. Windows Server AppFabric缓存主机应专用于缓存服务,这意味着这些服务器也不会用作应用程序,Web或数据库服务器。 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. 还要了解其他服务的处理器和网络利用率的高峰将对缓存集群的性能和稳定性产生负面影响。

Here is a link to this article: Article #1 以下是本文的链接: 文章#1

Now, this sounds reasonable enough, I was thinking that limiting amount of RAM AppFabric cache can use would be enough. 现在,这听起来很合理,我认为限制RAM AppFabric缓存可以使用的数量就足够了。 But, reading another article on MSDN I have found this: 但是,在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. 对于物理机和虚拟机,您应该记录缓存集群到使用缓存的应用程序或Web服务器的位置。 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. 在此阶段,您可能很想将您的应用程序或Web服务器用于缓存服务器。 Although possible, this is not supported. 尽管可能,但不支持此功能。 First, any resource usage spikes by services such as IIS on those machines could impact the cache cluster. 首先,这些机器上的IIS等服务的任何资源使用率都会影响缓存集群。 Second, the caching service assumes that it is on a dedicated server and can potentially use more much more memory than you specify. 其次,缓存服务假定它位于专用服务器上,并且可能使用比您指定的内存更多的内存。

Here is a link to this article: Article #2 以下是本文的链接: 文章#2

If I understand correctly statement above, this means that despite my config settings for AppFabric, it will take as much RAM as it wants? 如果我正确理解上面的声明,这意味着尽管我的AppFabric的配置设置,它将需要尽可能多的RAM吗? Can this be really true? 这真的可以吗? Has anyone some experience with configuration where application and AppFabric are located on the same machine? 有没有人在应用程序和AppFabric位于同一台机器上的配置方面有一些经验?

To share my story on appfabirc, we started using appfabric caching on a shared server, but eventually had to take it out because of the following issues... 为了在appfabirc上分享我的故事,我们开始在共享服务器上使用appfabric缓存,但由于以下问题最终不得不将其删除...

  1. we were trying to save objects in it, and do that you have to serialize the whole graph and send it to server, in a high demand scenario, not sure how much more efficient it is than puling from db itself. 我们试图在其中保存对象,并且这样做你必须序列化整个图并将其发送到服务器,在高需求的情况下,不确定它比db本身的效率更高效。 Plus you can say goodbye to any any delegates or events wireups, or async operations in your objects.. 此外,您可以告别对象中的任何代表或事件连线或异步操作。

  2. The caching service itself would intermittently throw errors saying its not avaialable and then you will have to go and check the health of it using powershell. 缓存服务本身会间歇性地抛出错误,说它不可用,然后你将不得不去使用powershell检查它的健康状况。 Also anytime your box is using more than 90% of RAM, it would stop working.. 此外,任何时候您的盒子使用超过90%的RAM,它将停止工作..

  3. Even if there is a little bit of memory pressure on the box, it aggressively tries to evict items from the cache and was always taking around 10-20% of cpu for that.... 即使盒子上有一点内存压力,它也会积极地试图从缓存中逐出物品并且总是占用大约10-20%的cpu ....

to sum it up, i think MS recommendation is correct that it needs to have its own dedicated cluster, but then again every application has its own unique needs and you should evaulate it against parameters in your deployment environment. 总而言之,我认为MS建议是正确的,它需要拥有自己的专用集群,但是每个应用程序都有自己独特的需求,您应该根据部署环境中的参数对其进行评估。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM